-
Notifications
You must be signed in to change notification settings - Fork 18k
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
x/tools/gopls: variable in third party package is not highlighted #43511
Comments
Will this issue be fixed in |
We are not yet sure when v1.0.0 will be released, but we will address it before that version. When the issue is resolved, it will be closed and moved to the milestone of the release for which it was actually fixed. |
I could find the cause of this behavior. // TypecheckFull means to use ParseFull.
TypecheckFull
// TypecheckWorkspace means to use ParseFull for workspace packages, and
// ParseExported for others.
TypecheckWorkspace
...
// ParseExported specifies that the public symbols are needed, but things like
// private symbols and function bodies are not.
// This mode is used for things where a package is being consumed only as a
// dependency.
ParseExported
// ParseFull specifies the full AST is needed.
// This is used for files of direct interest where the entire contents must
// be considered.
ParseFull So,
Related issue: #40809 (cc @heschi) Side note: |
Thanks for investigating this! I think it would be fine to reuse the content of GetParsedFile directly in the highlight code--it's not much logic, so I don't think it deserves a second helper. What do you think? |
Don't use GetParsedFile because it extracts a package with TypecheckWorkspace mode, but we want to support std and 3rd-party packages. So, we reuse the content of GetParsedFile directly in Highlight function with TypecheckFull mode. Fixes golang/go#43511
Change https://golang.org/cl/307171 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
nothing
What did you expect to see?
Code in my package:

What did you see instead?
Code in third party package:

Gopls(server) logs when I move cursor in
format
variable:The text was updated successfully, but these errors were encountered: