Add `codeql` executable to PATH of VS Code Terminal
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript, vscode
- Área
- developer-experience
Línea de trabajo
Comienza en extension.ts, en la función activate, y revisa la compatibilidad de VS Code con environmentVariableCollection. Compara la prueba de concepto con las preguntas abiertas sobre el orden de PATH, las actualizaciones de CLI, las rutas personalizadas y la activación del terminal; se considera terminado cuando el comportamiento previsto está definido y codeql está disponible en los terminales de VS Code compatibles.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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 https://github.com/microsoft/vscode-python/issues/11039 (might contain useful information and links).
Open questions:
- Should this be opt-in / opt-out (or always active without being possible to deactivate)?
- Should it prepend or append the CodeQL CLI directory to the PATH?
(would make a difference if the user has already anothercodeqlexecutable on the PATH) - Will this correctly handle CodeQL CLI updates performed by the extension (automatic or manually triggered)?
(or willcodeqlnot be available in all open terminals afterwards anymore) - Will this correctly handle setting a custom CodeQL CLI path in the settings while the extension is running?
(and what is the 'correct' behavior? maybe it is desired that already open Terminals keep using the previously used CodeQL CLI) - Will
codeqlbe 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 in extension.ts:
const collection = ctx.environmentVariableCollection;
const separator = process.platform === "win32" ? ";" : ":";
collection.prepend(
"PATH",
`C:\\Users\\user\\AppData\\Roaming\\Code\\User\\globalStorage\\github.vscode-codeql\\distribution16\\codeql${separator}`,
);
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
- Let the extension add the CodeQL CLI globally to the PATH, so it is available even outside of VS Code
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. - The user has to manually install CodeQL CLI, add it to the PATH and specify it in the extension settings
They won't receive automatic updates this way though.
- Lenguaje dominante
- TypeScript
- Estrellas
- 539
- Forks
- 240
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 37
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/vscode-codeql
-
bug VSCode
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/vscode-codeql#4471 · 1 comentario ·
-
bug enhancement VSCode
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/vscode-codeql#592 · 2 comentarios ·
-
enhancement VSCode
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
github/vscode-codeql#4432 · 1 comentario ·
-
bug VSCode
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
github/vscode-codeql#4339 · 1 comentario ·
Todos los issues de github/vscode-codeql
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modelcontextprotocol/inspector#2458 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
carbon-design-system/ibm-products#9907 ·