Add ability to use contextual queries to find references when already on a reference
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- devtools
Research direction
Start in extensions/ql-vscode/src/contextual/templateProvider.ts at line 70, where results are filtered against the selected position. Trace how contextual find-references results are produced for declarations and references. Done means selecting a reference in a Java source file finds the same references as selecting its declaration, while declaration behavior remains intact.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 539
- Forks
- 240
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 29
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/vscode-codeql
-
bug VSCode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/vscode-codeql#4471 · 1 comment ·
-
enhancement VSCode
Difficulty 3/5 1-2 days Newbie friendliness 55/100
github/vscode-codeql#4432 · 1 comment ·
-
bug VSCode
Difficulty 3/5 1-2 days Newbie friendliness 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Difficulty 3/5 1-2 days Newbie friendliness 64/100
github/vscode-codeql#4339 · 1 comment ·
-
CLI test failure Opencli-test-failure
Difficulty 3/5 1-2 days Newbie friendliness 32/100
github/vscode-codeql#4330 · 4 comments ·
All issues in github/vscode-codeql
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100