| tocdepth: | 1 |
|---|
You can edit the settings for the CodeQL extension to suit your needs.
The CodeQL extension comes with a number of settings that you can edit. These determine how the extension behaves, including: which version of the CodeQL CLI the extension uses, how the extension displays previous queries, and how it runs queries.
Open the Extensions view and right click CodeQL.
Click Extension Settings.
Edit a setting. The new settings are saved automatically.
The CodeQL extension uses the CodeQL CLI to run commands. If you already have the CLI installed and added to your PATH, the extension uses that version. This might be the case if you create your own CodeQL databases instead of downloading them from LGTM.com. Otherwise, the extension automatically manages access to the executable of the CLI for you. For more information about creating databases, see ":ref:`Creating CodeQL databases <creating-codeql-databases>`" in the CLI help.
To override the default behavior and use a different CLI, you can specify the CodeQL CLI Executable Path. Note that this is only available as a user setting, not as a workspace setting.
The query history Format setting controls how the extension lists queries in the query history. By default, each item has a label with the following format:
[%t] %q on %d - %s
%tis the time the query was run%qis the query name%dis the database name%sis a status string
To override the default label, you can specify a different format for the query history items.
There are a number of settings for Running Queries. If your queries run too slowly and time out frequently, you may want to increase the memory.
To save CodeQL Query Server logs in a custom location, edit the Running Queries: Custom Log Directory setting. If you use a custom log directory, the extension doesn't automatically delete the CodeQL Query Server logs. This is useful if you want to investigate these logs to improve the performance of your queries.
To increase the number of threads used for testing queries, you can update the Running Tests > Number Of Threads setting.
You can configure whether the CodeQL extension collects telemetry data. This is disabled by default. For more information, see ":doc:`About telemetry in CodeQL for Visual Studio Code <about-telemetry-in-codeql-for-visual-studio-code>`."
- User and workspace settings in the Visual Studio Code help
- ":ref:`CodeQL CLI <codeql-cli>`"