Skip to content
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: gopls semantic token registration problems #48600

Closed
mattmassicotte opened this issue Sep 24, 2021 · 2 comments
Closed

x/tools/gopls: gopls semantic token registration problems #48600

mattmassicotte opened this issue Sep 24, 2021 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@mattmassicotte
Copy link

mattmassicotte commented Sep 24, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16.3 darwin/arm64

Does this issue reproduce with the latest release?

It does reproduce with gopls 0.7.2

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/matt/Library/Caches/go-build"
GOENV="/Users/matt/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/matt/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/matt/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/local/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/local/lib/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="/usr/bin/clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7w/6mwnkkbn6jvdl27ng11c9zf00000gn/T/go-build4006803649=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I'm experimenting with the gopls semantic tokens support. I've enabled it in the server options, and things are working. But, I'm having an issue with the capability registration behavior.

gopls does not report a value for semanticTokensProvider. My understanding is this is intentional, and dependant on the result of a workspace/configuration request. This matches what I'm seeing.

However, with my default setup, my client was never receiving any client/registerCapability at all, for semantic tokens or anything else. It seems that my client must indicate that it accepts dynamic registration for the didChangeConfiguration client capability to receive any registrations at all.

Interestingly, my client is also passing in false for the workspaceFolders client capability. But, gopls is attempting to register workspace/didChangeConfiguration and workspace/didChangeWorkspaceFolders. I would have not have expected to see the workspace/didChangeWorkspaceFolders registration there. Perhaps this is an unrelated problem, but I figured I'd let you know just in case.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Sep 24, 2021
@gopherbot gopherbot added this to the Unreleased milestone Sep 24, 2021
@stamblerre
Copy link
Contributor

However, with my default setup, my client was never receiving any client/registerCapability at all, for semantic tokens or anything else. It seems that my client must indicate that it accepts dynamic registration for the didChangeConfiguration client capability to receive any registrations at all.

Interestingly, my client is also passing in false for the workspaceFolders client capability. But, gopls is attempting to register workspace/didChangeConfiguration and workspace/didChangeWorkspaceFolders. I would have not have expected to see the workspace/didChangeWorkspaceFolders registration there. Perhaps this is an unrelated problem, but I figured I'd let you know just in case.

Good catch on both of these--thank you for reporting! These are our mistakes, and I'll send a CL to fix them ASAP.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.7.3 Sep 24, 2021
@gopherbot
Copy link

Change https://golang.org/cl/352055 mentions this issue: internal/lsp: use the correct dynamic registration booleans

@golang golang locked and limited conversation to collaborators Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants