Add codeql
executable to PATH of VS Code Terminal
#3006
Labels
codeql
executable to PATH of VS Code Terminal
#3006
Is your feature request related to a problem? Please describe.
In some cases it is still necessary to use the CodeQL CLI, such as for creating a database (see also #306). If you don't want to manually install the CodeQL CLI but instead want to rely on the extension installing the latest version, this is a bit cumbersome because the executable is not by default available on the PATH, and its directory name (the
distributionX
part) changes after every CodeQL CLI update.Describe the solution you'd like
At least the extension could make the
codeql
executable available in the VS Code Terminal, see for example https://code.visualstudio.com/updates/v1_46#_environment-variable-collection, and possibly related microsoft/vscode-python#11039 (might contain useful information and links).Open questions:
(would make a difference if the user has already another
codeql
executable on the PATH)(or will
codeql
not be available in all open terminals afterwards anymore)(and what is the 'correct' behavior? maybe it is desired that already open Terminals keep using the previously used CodeQL CLI)
codeql
be available in the Terminal even if the extension hasn't been activated yet?(looks like this is the case if the extension had been activated previously when VS Code was open; not sure why this works)
As proof of concept I added locally the following to the
activate
function inextension.ts
:And that seems to work, making
codeql
available in the VS Code Terminal (if opened after the extension has been activated).Describe alternatives you've considered
Probably not easily possible in a portable way, might make it difficult to update the PATH when the CodeQL CLI is updated, and might also not properly update the PATH when the extension is uninstalled.
They won't receive automatic updates this way though.
The text was updated successfully, but these errors were encountered: