-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add queries for VS Code jump-to-definition #3308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cpp/ql/src/localDefinitions.ql
Outdated
* for jump-to-definition in the code viewer. | ||
* @kind definitions | ||
* @id cpp/jump-to-definition | ||
* @tags local-definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
@tags ide-contextual-queries/local-definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done.
d9729c2
to
6a59ce3
Compare
Possible arguments for "why use |
Those are good arguments, so let's focus on the possibility of using |
The reason is that |
Note that classify files does require different processing so it does need a new kind. |
Yes, and that can be done without changing LGTM since we'll just tweak the scripts to produce a suite with exactly one Thanks for clarifying. I have no further objections to classifying by tag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except formatting
We do need to tweak the current codeql suites though. |
Is the above commit sufficient for 'tweak the current codeql suites'? |
Perhaps the |
6f13e30
to
d49e936
Compare
Does the script for generating the LGTM query suites need to be updated as well? |
cpp/ql/src/localDefinitions.ql
Outdated
external string selectedSourceFile(); | ||
|
||
cached | ||
File getEncodedFile(string name) { result.getAbsolutePath().replaceAll(":", "_") = name } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to definitions.qll
?
Good question; I'm trying to find a
but when I run
which lacks the Any idea where that script is invoked with |
I think EDIT: No, I lie. Try |
e20dd5d
to
b82db2f
Compare
Ok, both of those generated a commandline with |
In any event, raised https://git.semmle.com/Semmle/code/pull/36810 to exclude queries by tag. |
b82db2f
to
e73833e
Compare
The legacy languages specify parts of their LGTM suites manually. For Go everything is auto-generated. |
Since this can have performance implications for the LGTM suite, I’d like to wait until the CPP-Differences jobs for #3400 have finished and then run CPP-differences for this PR too. I assume it’s not urgent to merge this since it’s targeted at master, and the |
I've started https://jenkins.internal.semmle.com/job/Changes/job/CPP-Differences/1107/ to test this PR for performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance LGTM. There's a noticeable slowdown on Wireshark, but that affects other queries too, so I think it's just noise.
The tags on these queries are a tentative proposal for how to signal to the vscode extension that they are the right template queries to run for jump-to-definition and find-references. I am very open to anything from bikeshedding their exact names, to arguments for using other mechanisms instead of tags.