Prerequisites
The CodeQL extension requires a minimum of Visual Studio Code 1.82.0. Older versions are not supported.
Installing the extension
You can install the CodeQL for Visual Studio Code extension using one of several different methods:
-
Using the Visual Studio Code Marketplace in a browser.
-
Searching in the "Extensions" view in Visual Studio Code.
-
Using a VSIX file.
Using the Visual Studio Code Marketplace
-
In your browser, go to the "CodeQL" page in the Visual Studio Code Marketplace.
-
Click Install, then follow the on-screen prompts.
Searching in the "Extensions" view
-
In VS Code, open the "Extensions" view.
-
Search for "CodeQL", then click Install.
Using the CodeQL VSIX file
-
Download the CodeQL VSIX file from the
github/vscode-codeql
repository on GitHub. -
In VS Code, open the "Extensions" view.
-
At the top right of the sidebar, click the ellipsis then click Install from VSIX....
-
Select the CodeQL VSIX file downloaded in step 1.
-
Follow the on-screen prompts to complete the installation.
Next steps
To learn how to work with CodeQL databases in the extension, see "Managing CodeQL databases."
If you have already found, downloaded, or created a CodeQL database, you can learn how to use the extension to run queries on CodeQL databases and view the results. For more information, see "Running CodeQL queries."
To learn how to configure access to a different version of the CodeQL CLI than the one installed with the extension, see "Configuring access to the CodeQL CLI."
To learn how to set up a CodeQL workspace, see "Setting up a CodeQL workspace."