Add `codeql` executable to PATH of VS Code Terminal
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript, vscode
调研方向
从 extension.ts 中的 activate 函数开始,检查 VS Code 对 environmentVariableCollection 的支持。将概念验证与有关 PATH 顺序、CLI 更新、自定义路径和终端激活的未决问题进行比较;当预期行为已定义,并且 codeql 在受支持的 VS Code 终端中可用时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 539
- 派生
- 240
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 29
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/vscode-codeql 的其他 Issue
-
bug VSCode
难度 2/5 1-3 小时 新手友好度 68/100
github/vscode-codeql#4471 · 1 条评论 ·
-
bug enhancement VSCode
难度 2/5 1-3 小时 新手友好度 68/100
github/vscode-codeql#592 · 2 条评论 ·
-
enhancement VSCode
难度 3/5 1-2 天 新手友好度 55/100
github/vscode-codeql#4432 · 1 条评论 ·
-
bug VSCode
难度 3/5 1-2 天 新手友好度 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
难度 3/5 1-2 天 新手友好度 64/100
github/vscode-codeql#4339 · 1 条评论 ·
查看 github/vscode-codeql 的全部 Issue
相似的 Issue
-
S: triage
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) 未关闭
难度 2/5 1-3 小时 新手友好度 90/100
snapshot-labs/stamp#666 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
GauravKarakoti/SecureFlow#1070 · 1 条评论 ·
-
feature:Languages/Translations good first issue ready Web
难度 2/5 1-3 小时 新手友好度 72/100
digitalfabrik/integreat-app#4394 ·