Codespaces is a product from GitHub that allows users to use a hosted version of VS Code to edit their GitHub repositories online.
- Fork the vscode-codeql-starter repo.
- Create and open a codespace on the
main
branch.
- Open the workspace file
vscode-codeql-starter.code-workspace
and make sure codespaces reloads so that it is using that workspace file. (This may happen automatically.) - Install a QL database archive from somewhere on the internet or from your local machine (see below...)
- In your browser, navigate to a project on LGTM, for example: https://lgtm.com/projects/g/jasmine/jasmine/
- Copy the project's URL.
- In VS Code, run the CodeQL: Download Database from LGTM command.
- Paste the project's URL when prompted.
- If prompted, select the language of the database you are downloading.
- The database will then be downloaded and installed into your workspace.
- Zip a database on your local machine
- Drag and drop the zip file to the explorer tree in your codespace
- Right click on the uploaded file, and choose CodeQL: Set Current Database
- In the databases view, click on the cloud icon and enter the url of the database you want to download
Note: must be a zip file, and must be publicly accessible.
If you want to run a custom version of the extension to grab some not-yet-released features:
- Get the download link of the extension to install
- Download to your local machine
- Drag and drop the zip file to the codespace
- Unzip the file to get a single file with a vsix extension
- In the
.devcontainer/devcontainer.json
file, delete thegithub.vscode-codeql
line - Run the command "Extensions: Install from VSIX"
- Select the unzipped vsix file
- You will need to reload the page after install
- Verify that your version of the extension is correct in the extensions tab.