Method signature and method documentation can be out of sync in IntelliSense
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
Research direction
Start by reproducing the behavior with the QL query in the issue and inspect the IntelliSense path that combines method signatures with QLDoc. Done means the displayed parameter list and documentation come from the same method definition when an override has no QLDoc of its own.
Written by the indexing model from the issue text.
Description
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.
- 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 ·
-
bug enhancement VSCode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/vscode-codeql#592 · 2 comments ·
-
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 ·
All issues in github/vscode-codeql
Similar issues
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
chrisparsons83/flexspotff#153 ·