Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Quick-eval targets ending in a comment are deemed invalid

未关闭
#743 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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 天 6 小时
30 天内合并 PR
29

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/vscode-codeql 的其他 Issue

查看 github/vscode-codeql 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。