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

Method signature and method documentation can be out of sync in IntelliSense

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript, vscode

调研方向

首先使用 issue 中的 QL 查询重现该行为,并检查将方法签名与 QLDoc 结合的 IntelliSense 路径。当 override 没有自己的 QLDoc 时,显示的参数列表和文档来自同一个方法定义,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug VSCode

Describe the bug
This was discussed on Slack where I suggested this could be handled via a compiler warning. Thinking about it some more, however, I think it could equally be handled through a small change in the IDE.

(I wasn't sure whether to classify this as a bug, but it certainly is suprising and potentially confusing behaviour, so I figured "bug" was the most suitable label.)

To Reproduce
Create a query file with the following contents

class SmallNat extends int {
    SmallNat() { this in [0 .. 10] }
}
class Super extends int {
    Super() { this in [1, 2] }
    /** Gets the result of subtracting `bar` from `foo`. */
    int subtract(SmallNat foo, SmallNat bar) { result = foo - bar }
}
class Sub extends Super {
    Sub() { this = 1 }
    override int subtract(SmallNat bar, SmallNat foo) { result = bar - foo }
}
from Sub s, int val
where val = s.subtract(7, 5)
select val

If you hover over the call to s.subtract, the IntelliSense displayed will have the QLDoc associated with Super::subtract, but the parameter list associated with Sub::subtract (and thus incorrectly specify the behaviour of Sub::subtract).

Expected behavior
The parameter list should agree with the QLDoc presented. The most convenient way of achieving this would be to simply reuse the parameter list from Super::subtract when Sub::subtract doesn't supply any QLDoc of its own. In other words, making sure that the parameter list displayed comes from the same method definition as the QLDoc displayed.

主要语言
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 摘要。