Install the CodeQL extension and configure the CLI!
This is not strictly mandatory, but you probably want something like this:
my_workspace/
.vscode/
settings.json
codeql/
my_company/
my_project/
my_query1.ql
my_query2.ql
...
qlpack.yml
queries.xml
Where codeql/
is a clone of this repository: https://github.com/github/codeql . Symlinking didn't work for me.
Excluding CodeQL libraries from VS Code's file system watcher (there are too many files in there):
{
"files.watcherExclude": {
"**/codeql/**": true
}
}
Metadata for your queries. The libraryPathDependencies
attribute helps the extension to find the language specific libraries and configure IntelliSense.
name: codeql-my-queries-foo
version: 0.0.0
libraryPathDependencies: codeql-MYLANGUAGE
Without this file queries won't execute.
<queries language="MYLANGUAGE"/>
If IntelliSense doesn't work despite following the above configuration, try 1) saving the workspace 2) and restart VSCode.