x/tools/gopls: Enable semanticTokens when running gopls from the CLI #64884
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
gopls version
v0.11.0
go env
What did you do?
TLDR
I don't see any way to enable
semanticTokens
(seems off by default) when runninggopls
from the CLI. How does one pass configurations equivalent to thesettings.json
when in such a setting?Long Version
I am trying to extract semantic tokens from
gopls
in the terminal. Towards this, I have written up the following rudimentary JsonRPC client that inits the server, opens the document, queries semantic tokens, closes the document and finally shuts down the server connection.However on running this I get the following logs:
It appears the semantic tokens are disabled by default and can only be enabled by editing the
settings.json
file which only seems to apply when running the language server from within the IDE. How does one go about enabling this when running it on the CLI? I don't see any way to pass a settings file to the CLI executable.What did you expect to see?
Semantic tokenization of Go source file.
What did you see instead?
{'jsonrpc': '2.0', 'error': {'code': 0, 'message': 'semantictokens are disabled'}, 'id': 2}
Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered: