Add ability to use contextual queries to find references when already on a reference
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- devtools
调研方向
从 extensions/ql-vscode/src/contextual/templateProvider.ts 的第 70 行开始,这里会根据选定的位置筛选结果。跟踪 contextual find-references 如何为声明和引用生成结果。完成的标准是:在 Java 源文件中选择一个引用时,找到的引用与选择其声明时相同,同时声明行为保持不变。
由索引模型根据 Issue 内容生成。
描述
I'm not exactly sure whether this is a feature request or a bug report. Regardless, this is behaviour that is not implemented, but I would expect it to be.
When running the find references contextual query, on a token in a database source file, no references will be found if the token represents a reference itself. References will only be found if the selected token is a declaration. For instance:
int /* 1 */ myMethod() {
/* 2 */ myMethod();
/* 3 */ myMethod();
}
If you place the caret at 2 or 3, no references will be found. If you place the caret at 1 References will be found at 2 and 3. Most other language servers will find references for 2 and 3 regardless of which reference is selected.
The problem is not related to the queries themselves. Rather, it happens here:
https://github.com/aeisenberg/vscode-codeql/blob/353a87de12ca818293aeb3199d057a23a24cc403/extensions/ql-vscode/src/contextual/templateProvider.ts#L70-L70
This function will take all possible results and filter out results that do not contain the selected position. This makes sense when the selected position is the declaration, but it does not make sense if the position is a reference.
- 主要语言
- 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 条评论 ·
-
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 条评论 ·
-
CLI test failure 未关闭cli-test-failure
难度 3/5 1-2 天 新手友好度 32/100
github/vscode-codeql#4330 · 4 条评论 ·
查看 github/vscode-codeql 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
vicharanashala/fln#563 ·