Main Content

Install Polyspace as You Code Extension in Visual Studio Code

The Polyspace® as You Code extension in the Visual Studio Code IDE allows you to run Polyspace on the file that you are currently viewing and see analysis results such as bugs and coding standard violations. You must install the Polyspace as You Code analysis engine to run the analysis. The extension allows you to point to this analysis engine from Visual Studio Code and show results produced by the Polyspace analysis.

You can install the extension in one of two ways:

  • While running the Polyspace as You Code installer, select the option to install the extension. The installer installs the Polyspace as You Code analysis engine and the extension.

    See Install Polyspace as You Code Using Installer.

  • If you install only the analysis engine while running the Polyspace as You Code installer, use the Visual Studio Code extension installer (VSIX) file at a later time. The VSIX file is available only after you run the installer.

The rest of this topic describes the second approach where you skip the installation of the extension while running the installer and use the VSIX file to install the extension later.

Note

If you use Visual Studio Code version 1.57.1 or later, the Polyspace as You Code extension is disabled when you open a folder in Restricted Mode. To enable the extension, mark the folder as trusted. See Workspace Trust.

Interactive Installation

To install the extension interactively:

  1. In the Visual Studio Code IDE, select View > Extensions.

  2. On the EXTENSIONS pane, click the ellipsis on the upper right and select Install from VSIX.

    Installation menu

  3. Navigate to the VSIX file in the folder polyspaceroot\polyspace\plugin\visual_studio_code.

    Here, polyspaceroot is the Polyspace as You Code installation folder, for instance, C:\Program Files\Polyspace as You Code\R2024a.

After installation, you can see the extension in the EXTENSIONS pane.

To uninstall the extension, on the EXTENSIONS pane, click the settings icon icon and select Uninstall.

Command-Line Installation

You can also install the extension using the VSIX file at the command line.

  • To install the extension, in a command window, enter:

    code --install-extension polyspaceroot\polyspace\plugin\visual_studio_code\polyspace_as_you_code.vsix

  • To uninstall the extension, enter:

    code --uninstall-extension polyspaceroot\polyspace\plugin\visual_studio_code\polyspace_as_you_code.vsix

Related Topics