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: semantictokens are disabled #43353

Closed
christianbundy opened this issue Dec 23, 2020 · 1 comment
Closed

x/tools/gopls: semantictokens are disabled #43353

christianbundy opened this issue Dec 23, 2020 · 1 comment

Comments

@christianbundy
Copy link

@christianbundy christianbundy commented Dec 23, 2020

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

$ go version
go version go1.15.6 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output ```console $ go env go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/christianbundy/Library/Caches/go-build" GOENV="/Users/christianbundy/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/christianbundy/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/christianbundy/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/Cellar/go/1.15.6/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.15.6/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mf/bnj093qs5sl8lkpz773d0m9c0000gn/T/go-build455103357=/tmp/go-build -gno-record-gcc-switches -fno-common" ```

What did you do?

I sent a textDocument/semanticTokens/full request to gopls.

What did you expect to see?

I'd expect a response that contained semantic tokens.

What did you see instead?

{"jsonrpc":"2.0","error":{"code":0,"message":"semantictokens are disabled"},"id":2}

I've found documentation that describes settings, but when I create settings.json with the following contents it doesn't resolve the issue:

{
  "gopls": {
    "semanticTokens": true
  }
}

Here are the exact commands that I'm sending:

Content-Length:      334

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"rootUri":"file:///Users/christianbundy/Source/lsp-editor/hello.go","workspaceFolders":[{"uri":"file:///Users/christianbundy/Source/lsp-editor/","name":"lsp-editor"}],"capabilities":{"semanticTokens":{"requests":{"full":true}}},"initializetionOptions":{"semanticTokens":true}}}
Content-Length:       60

{"jsonrpc":"2.0","id":2,"method":"initialized","params":{}}
Content-Length:      125

{"jsonrpc":"2.0","id":1,"method":"workspace/didChangeConfiguration","params":{"settings":{"gopls":{"semanticTokens":true}}}}
Content-Length:      161

{"jsonrpc":"2.0","id":2,"method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///Users/christianbundy/Source/lsp-editor/hello.go"}}}
@gopherbot gopherbot added this to the Unreleased milestone Dec 23, 2020
@christianbundy
Copy link
Author

@christianbundy christianbundy commented Dec 23, 2020

Ha! I spelled "initializationOptions" wrong. 🤦

Just got a response:

{"jsonrpc":"2.0","result":{"resultId":"2020-12-23 12:17:10.435932 -0800 PST m=+40.572894509","data":[0,0,7,0,0,0,8,4,0,0,1,0,6,0,0,0,8,3,0,0,1,0,4,0,0,0,5,4,0,0,1,4,3,0,0,0,4,7,0,0,0,8,13,0,0]},"id":2}

Admittedly that data structure isn't what I was expecting, but I'm sure it's documented somewhere. Sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants