Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Quick-eval targets ending in a comment are deemed invalid

未關閉
#743 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 6 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
typescript, vscode

研究方向

使用提供的 QL 程式碼片段在 VS Code CodeQL 擴充功能中重現 quick-eval,選取以註解結尾的行。追蹤 quick-eval 的進入點和選取範圍處理,然後驗證選取範圍末尾的註解會被忽略,而選取範圍內的註解維持不受影響。

由索引模型根據 Issue 內容生成。

描述

bug VSCode

Describe the bug
If the piece of code selected for quick eval ends in a comment (// or /* ... */), then quick-eval fails. This is especially troublesome if one is selecting a subset of lines using the left margin, and the last of these happens to have a comment attached.

Comments inside the selected block are unproblematic. The problem only arises at the end of a selection.

To Reproduce
Put the following code in a suitable QL buffer. Select the line starting with result and do a quick-eval.

int getRandomNumber() {
  result = 4 // chosen by fair dice roll. guaranteed to be random.
}

Expected behavior
The comment is ignored, and quick-eval executes successfully

Additional context
Seen using CodeQL extension version 1.3.10 and CLI version 2.4.2+202102021519plus (built locally)

主要語言
TypeScript
星號
539
分支
240
平均合併
2 天 18 小時
30 天內合併 PR
37

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/vscode-codeql 的其他 Issue

查看 github/vscode-codeql 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。