Installing the VS Code extension

To install the Perforce Static Analysis extension for VS Code:

  1. Download the applicable Klocwork Desktop tools package (kw-desktop-tools.<version>.<platform>.zip) from Support Downloads.
    The VS Code extension is Klocwork Server version agnostic. You can install a newer version of the extension by downloading a newer or latest version of the Klocwork Desktop tools package, while keeping your Klocwork Server at an earlier version. This allows you to support later versions of VS Code and take advantage of certain bug fixes.

    Log in to the site using your Rogue Wave Support Center user ID and password. If you do not currently have a Rogue Wave Support Center user ID and password, register as a new user. Active maintenance is required to access this page.

    You can download the zip package directly from the Downloads section in the Validate Portal if your administrator has deployed the desktop analysis plug-ins. See Downloading and deploying the desktop analysis plug-ins for more information.
  2. Once downloaded, unzip the package into your preferred location.
  3. In VS Code, click View>Extensions.
  4. In the Extensions panel, click ...>Install from VSIX....
  5. Navigate to the VSIX file that you downloaded (for example, "p4savscodeextension.vsix") and select Install.
  6. In the Extensions panel, click Refresh. The extension now appears in your Extensions panel.
  7. Right-click the Perforce Static Analysis extension, then click Extension Settings.

  8. To enable the Klocwork panel, under the Perforce Static Analysis: Active Tool Selection list, click Klocwork.

The Klocwork panel is now visible on the left side of the IDE and all Klocwork commands are available.

Configuring your settings

To configure your settings:
  1. In VS Code, click View>Extensions.
  2. Right-click the Perforce Static Analysis extension, then click Extension Settings. You can configure the following Klocwork System Properties:
    • 32-bit Analysis: select the checkbox to use the 32-bit analysis tools.
    • Continuous Analysis Enabled: select the checkbox to allow continuous analysis to run against your project, or clear the checkbox to run analysis on demand.
    • Display Klocwork Analysis Results When Workspace Loaded: determine which Klocwork diagnostics are displayed, when opening a workspace with previously generated analysis results.
    • Help: Source: specify where to access Klocwork checker help from the server (default) or online.
    • Klocwork Tools Location: specify the location of the Klocwork command line tools. This is required to run analysis (for example, "C:\Klocwork\Command Line 21.1\bin"). The extension can also pick up this setting from the PATH environment variable. For instructions on how to install these tools, see Installing the Build Tools package.
    • Logging Level: determine the level of details provided in the Klocwork output log.
    • System: Encoding: (optional) specify the encoding used by the system. If left blank, "UTF-8" will be used.