8000 semantic tokens - type not in legend (ignored) · Issue #3000 · golang/vscode-go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

semantic tokens - type not in legend (ignored) #3000

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

Closed
flowchartsman opened this issue Oct 6, 2023 · 4 comments
Closed

semantic tokens - type not in legend (ignored) #3000

flowchartsman opened this issue Oct 6, 2023 · 4 comments

Comments

@flowchartsman
Copy link
flowchartsman commented Oct 6, 2023

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
go version go1.21.2 darwin/arm6
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
Build info
----------
Build info
----------
golang.org/x/tools/gopls v0.14.0-pre.2
    golang.org/x/tools/gopls@v0.14.0-pre.2 h1:5GvHcXCyjPrluj4QCG2tb8NPyNwDT5y52g53Z7d+Ou8=
    github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
    github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
    golang.org/x/mod@v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
    golang.org/x/sync@v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
    golang.org/x/sys@v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
    golang.org/x/telemetry@v0.0.0-20231003223302-0168ef4ebbd3 h1:vxxQvncMbcRAtqHV5HsHGJkbya+BIOYIY+y6cdPZhzk=
    golang.org/x/text@v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
    golang.org/x/tools@v0.13.1-0.20231005170247-117a486e6b4a h1:+VSIj4o3PJNbcHbsFE9Elp24Hx6V5dSqBZ8FAKks+58=
    golang.org/x/vuln@v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU=
    honnef.co/go/tools@v0.4.5 h1:YGD4H+SuIOOqsyoLOpZDWcieM28W47/zRO7f+9V3nvo=
    mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
    mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.21.2
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
1.83.0
e7e037083ff4455cf320e344325dacb480062c3c
arm64
  • Check your installed extensions to get the version of the VS Code Go extension
Go Nightly
v2023.9.2722
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
Checking configured tools....
GOBIN: undefined
toolsGopath: 
gopath: /Users/andy/go
GOROOT: /opt/homebrew/Cellar/go/1.21.2/libexec
PATH: /Users/andy/.rd/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/andy/bin:/Users/andy/opt/bin:/Users/andy/opt/go/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion Tech Preview.app/Contents/Public:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/andy/.cargo/bin:/Users/andy/.fzf/bin

	go:	/opt/homebrew/bin/go: go version go1.21.2 darwin/arm64

	gotests:	/Users/andy/go/bin/gotests	(version: v1.6.0 built with go: go1.21.2)
	gomodifytags:	/Users/andy/go/bin/gomodifytags	(version: v1.16.0 built with go: go1.21.2)
	impl:	/Users/andy/go/bin/impl	(version: v1.1.0 built with go: go1.21.2)
	goplay:	/Users/andy/go/bin/goplay	(version: v1.0.0 built with go: go1.21.2)
	dlv:	/Users/andy/go/bin/dlv	(version: v1.21.1 built with go: go1.21.2)
	golangci-lint:	/Users/andy/go/bin/golangci-lint	(version: v1.54.2 built with go: go1.21.2)
	gopls:	/Users/andy/go/bin/gopls	(version: v0.14.0-pre.2 built with go: go1.21.2)

go env
Workspace Folder (clarion): /Users/andy/devel/clarion
	GO111MODULE=''
	GOARCH='arm64'
	GOBIN=''
	GOCACHE='/Users/andy/Library/Caches/go-build'
	GOENV='/Users/andy/Library/Application Support/go/env'
	GOEXE=''
	GOEXPERIMENT=''
	GOFLAGS=''
	GOHOSTARCH='arm64'
	GOHOSTOS='darwin'
	GOINSECURE=''
	GOMODCACHE='/Users/andy/go/pkg/mod'
	GONOPROXY=''
	GONOSUMDB=''
	GOOS='darwin'
	GOPATH='/Users/andy/go'
	GOPRIVATE=''
	GOPROXY='https://proxy.golang.org,direct'
	GOROOT='/opt/homebrew/Cellar/go/1.21.2/libexec'
	GOSUMDB='sum.golang.org'
	GOTMPDIR=''
	GOTOOLCHAIN='auto'
	GOTOOLDIR='/opt/homebrew/Cellar/go/1.21.2/libexec/pkg/tool/darwin_arm64'
	GOVCS=''
	GOVERSION='go1.21.2'
	GCCGO='gccgo'
	AR='ar'
	CC='cc'
	CXX='c++'
	CGO_ENABLED='1'
	GOMOD='/dev/null'
	GOWORK=''
	CGO_CFLAGS='-O2 -g'
	CGO_CPPFLAGS=''
	CGO_CXXFLAGS='-O2 -g'
	CGO_FFLAGS='-O2 -g'
	CGO_LDFLAGS='-O2 -g'
	PKG_CONFIG='pkg-config'
	GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/m4/ktknc01s62d5556jb375wjqh0000gn/T/go-build3589212960=/tmp/go-build -gno-record-gcc-switches -fno-common'

Share the Go related settings you have added/edited

  // EXTENSIONS
  // GO
  "[go]": {
    "editor.parameterHints.enabled": true,
  },
  "go.lintOnSave": "workspace",
  "go.coverageOptions": "showUncoveredCodeOnly",
  "go.enableCodeLens": {
    "runtest": true,
  },
  "go.toolsManagement.autoUpdate": true,
  "gopls": {
    "ui.semanticTokens": true,
    "formatting.gofumpt": true,
    "codelenses": {
      "gc_details": true,
    },
  },

Additionally:
image

Though the problem still occurs if it is set to "true", regardless of the theme.

Describe the bug

I am designing a syntax highlighting theme (not pictured), and was attempting to integrate semantic tokens, however there seems to be an issue with the LSP delivering them to the editor. Even using the default themes like Dark+ (pictured), which ostensibly support semantic hightlighting, when I use Developer: Inspect Editor Tokens and Scopes all tokens have the following under semantic token type (and modifiers, when it appears): not in legend (ignored).

image

I recall this working before, and there is a single reddit thread describing the same issue, which is very recent (6 days ago at the time of this writing), so it's possible this is a recent breaking change? I will bisect, and update the issue if I can find a working version.

Steps to reproduce the behavior:

  1. open the command palette with ctrl/cmd + shift + p
  2. type or select Developer: Inspect Editor Tokens and Scopes
  3. Click on a language feature that should have a semantic token.

Screenshots or recordings

(above)

@gopherbot gopherbot added this to the Untriaged milestone Oct 6, 2023
@flowchartsman
Copy link
Author

Uninstalling nightly and using the normal extension and then using Go: Install/Update tools seems to have resolved the issue, so whatever is broken it seems likely that it occurred between gopls v0.13.2 (which is now installed) and gopls v0.14.0-pre.2 (which was installed by the Nightly extension). Still unsure if this is a problem with Nightly or gopls, so if this ends up being a gopls issue, I can move it there. Thanks!

@pjweinb
Copy link
pjweinb commented Oct 6, 2023 via email

@flowchartsman
Copy link
Author

yes, this is definitely a regression. One can see it most easily by looking at imports, where, for instance 'runtime/pprof' is all one color without semantic tokens, and two different colors with semantic tokens. gopls v0.13.2 shows semantic tokens. and 14 doesn't. It's gopls, not vscode-go.

Seems reasonable. I've submitted a bug report upstream, and, provided there aren't any changes that need to be made to vscode-go, this can probably be closed. Will leave that to the maintainers.

@hyangah
Copy link
Contributor
hyangah commented Oct 10, 2023

Thanks for the report. The upstream issue was fixed and we will release v0.14.0-pre.3 with the fix next week.

@hyangah hyangah closed this as completed Oct 10, 2023
@hyangah hyangah modified the milestones: Untriaged, v0.40.0 Oct 10, 2023
@golang golang locked and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
0