CodeScan for Visual Studio CodeCodeScan is a Visual Studio Code extension that provides on-the-fly feedback to developers on new bugs and quality issues injected into Apex and VisualForce code. How it worksSimply open a Apex or VisualForce file, start coding, and you will start seeing issues reported by CodeScan. Issues are highlighted in your code, and also listed in the 'Problems' panel. You can access the detailed rule description directly from your editor, using the provided contextual menu. You can find all available rules descriptions on the dedicated CodeScan Knowledgebase RequirementsThe CodeScan language server needs a Java Runtime (JRE) 17+. If a Java runtime is already installed on your computer, CodeScan should automatically find and use it. Here is how CodeScan will search for an installed JRE (in priority order):
CodeScan then uses the first JRE found in these steps to check its version. If a suitable JRE cannot be found at those places, CodeScan will ask for your permission to download and manage its own version. JS/TS analysis specific requirementsTo analyze JavaScript and TypeScript code, CodeScan requires Node.js executable. The minimal supported version is
Analysis of TypeScript in CodeScan Cloud requires the server to use version 8.1 or above. Java analysis specific requirementsTo enable the support for Java analysis, you need the Language support for Java VSCode extension (version 0.56.0 or higher). You also need to be in standard mode. Connected ModeYou can connect to CodeScan by binding your VSCode workspace folder to your CodeScan project(s), and benefit from the same rules and settings that are used to inspect your project on the server. CodeScan in VSCode then hides Won’t Fix and False Positive issues in any file from a bound folder. Connection SetupIn v3.8 and above of CodeScan for VSCode, to set up CodeScan connections, navigate to the CODESCAN > CONNECTED MODE view container in the VS Code Activity Bar. Select Add CodeScan Connection, and complete the fields. If your connection is to a self-hosted Codescan, you do not need to input organization-key. Token can be generated using these pages:
Unique Connection Name is a friendly name for your connections. In the case of multiple connections, it also acts as a Select Save Connection and verify that the new connection was set up successfully in the Connected Mode view. Project BindingCodeScan keeps server-side data in a local storage. If you change something on the server such as the Quality Profile, CodeScan will automatically attempt to synchronize with configured servers at startup & once every hour, and will do its best to synchronize with the most appropriate branch from the server. Additionally, you can trigger an update of the local storage using the "CodeScan: Update all project bindings to CodeScan" command on the command palette. Project Binding SetupFrom v3.10, CodeScan for VSCode tries to automatically detect a remote CodeScan project to bind with the locally opened workspace folder. If no remote match is found, you will be prompted to configure binding manually. To manually configure a project binding, open the CONNECTED MODE view and select Add Project Binding for the desired connection. If your open workspace contains multiple folders, you will be prompted to choose a specific folder. After selecting the folder, choose the remote CodeScan project you would like to bind. Select the desired project and enjoy Connected Mode! You can also edit or delete bindings from the CONNECTED MODE view. Action buttons in the UI used to edit/delete existing, or create additional bindings will be revealed when hovering over each connection. Have Questions or Feedback?For CodeScan support questions, please first read the FAQ. LicenseCopyright 2017-2024 CodeScan. Licensed under the GNU Lesser General Public License, Version 3.0 |