Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Go contextual queries (find definitions and references) are not working #357

Closed
aeisenberg opened this issue Sep 25, 2020 · 4 comments
Closed

Comments

@aeisenberg
Copy link
Contributor

Conextual queries for find references and definitions are not returning any results for go in VS Code. Currently using 2ba9bbf in the latest release of VSCode extension for codeql and master of vscode-codeql-starter workspace.

To reproduce:

  1. Install https://lgtm.com/projects/g/kubernetes/kubernetes/ into vscode as a go database
  2. Open src/opt/src/cmd/verifydependencies/verifydependencies.go
  3. On line 178, select collector right-click -> find references

BUG
Expected: References to that symbol are found on line 186 and elsewhere
Actual: no references

Similarly, select the collector symbol on line 186 and invoke Go to Definition. No results are found.

See also github/codeql#4351 for a similar problem in C#.

@max-schaefer
Copy link
Collaborator

Thank you for your report. I'm trying to reproduce, but...

On line 178

verifydependencies.go only seems to have 101 lines. Am I looking at the wrong file?

I've tried a few other jump-to-definitions, and they all seem to work.

@aeisenberg
Copy link
Contributor Author

aeisenberg commented Sep 28, 2020

Oops. Sorry. Pasted the wrong file. It is src/opt/src/cmd/preferredimports/preferredimports.go. Thanks for taking a look.

Too be clear, though, I have this issue for all symbols I've tried in a go database. Not just the one above.

@max-schaefer
Copy link
Collaborator

Thank you for the update. I have now found the location you reported, but am unable to consistently reproduce. I think I got it to fail once, but since then it's been resolving references correctly every time I've tried again, so I'm kind of doubting my recollection of the time it failed, I may have just clicked on the wrong button then.

@aeisenberg
Copy link
Contributor Author

Sorry for the noise, but this is looking like a vscode-codeql issue. It is not properly handling databases downloaded from LGTM whose source folders are unzipped. See the explanation here: github/codeql#4351

I'll close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants