You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spin off from https://go.dev/issue/50262: we should add semantic token support for go:directives, so that they stand out as semantically significant. That issue was discussing go:embed support, but if we are going to highlight go:embed, we should highlight other go directives as well.
The text was updated successfully, but these errors were encountered:
findleyr
added
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
labels
Oct 13, 2023
Emphasizing the go: directives is a good idea. Maybe tokNamespace, which
generally seems to be a contrasting color.
1. Some go:directives (e.g. go:build) have to appear before the package
statement. Failing to emphasize a go: directive when it is being used
incorrectly seems like a good idea too.
2. The comment-handling code is at line 144. vscode does not support
overlapping tokens.
3. The new capability would need new tests...
I checked go:build and there is an existing warning ("misplaced //go:build comment") that pops up even if the directive is a semantic token. The same is true for go:embed warnings implemented in the issue this spun off from.
Spin off from https://go.dev/issue/50262: we should add semantic token support for go:directives, so that they stand out as semantically significant. That issue was discussing go:embed support, but if we are going to highlight
go:embed
, we should highlight other go directives as well.It probably suffices to add logic here:
https://cs.opensource.google/go/x/tools/+/master:gopls/internal/lsp/semantic.go;l=418;drc=fb4bd11ef6feea8f26ff371d1fcca356511e2e26
We already look inside basic lits of importSpecs to highlight package names, I expect this task would be similar:
https://cs.opensource.google/go/x/tools/+/master:gopls/internal/lsp/semantic.go;l=901;drc=fb4bd11ef6feea8f26ff371d1fcca356511e2e26
@vikblom indicated interest in taking this on.
CC @pjweinb
The text was updated successfully, but these errors were encountered: