Add `codeql` executable to PATH of VS Code Terminal
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript, vscode
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
Bắt đầu trong extension.ts tại hàm activate và xem xét khả năng hỗ trợ environmentVariableCollection của VS Code. So sánh proof of concept với các câu hỏi còn bỏ ngỏ về thứ tự PATH, việc cập nhật CLI, các đường dẫn tùy chỉnh và việc kích hoạt terminal; được xem là hoàn tất khi hành vi dự kiến đã được xác định và codeql khả dụng trong các terminal VS Code được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 539
- Fork
- 240
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 29
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/vscode-codeql
-
bug VSCode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/vscode-codeql#4471 · 1 bình luận ·
-
bug enhancement VSCode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/vscode-codeql#592 · 2 bình luận ·
-
enhancement VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
github/vscode-codeql#4432 · 1 bình luận ·
-
bug VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
github/vscode-codeql#4339 · 1 bình luận ·
Tất cả issue của github/vscode-codeql
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·