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: recent updates made VS Code colors broken #46450

Closed
inliquid opened this issue May 29, 2021 · 5 comments
Closed

x/tools/gopls: recent updates made VS Code colors broken #46450

inliquid opened this issue May 29, 2021 · 5 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.

Comments

@inliquid
Copy link

  1. VS Code
  2. go1.16.4
  3. gopls@master

Here is what it looks like on gopls@latest (v0.6.11):
изображение

Here is what it looks like on gopls@master (installed with go install):
изображение

@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 May 29, 2021
@gopherbot gopherbot added this to the Unreleased milestone May 29, 2021
@stamblerre
Copy link
Contributor

The change that caused this was https://golang.org/cl/323169, which enables semantic tokens through the LSP rather than through VS Code's default textmate grammar. This implementation follows the LSP specification of the semantic tokens feature, which does not allow the server to specify any specific colors.

It seems possible that your color theme may not support this feature well. For example, I see different colors for log.Printf with my theme, and it seems like yours uses an underline instead. I would suggest filing an issue about the theme, if you don't like it, or switching to a different one.

Screen Shot 2021-05-29 at 5 36 35 PM

@stamblerre
Copy link
Contributor

You can also disable the semantic tokens feature through the

	"gopls": {
		"ui.semanticTokens": true
        }

setting, but note that we do intend to deprecate the original grammar in the future.

@inliquid
Copy link
Author

I'm using standard "Monokai" color theme of VS Code. You can switch it easily back and forth in VS Code command prompt. Please also note that there is no highlighting of formatting verbs %s, %v and special symbols, such as \n, which degrades user experience quite significantly when working with strings.

Is there any way to stick to old scheme?

@stamblerre stamblerre modified the milestones: Unreleased, gopls/unplanned Jun 1, 2021
@stamblerre stamblerre added this to To Do in gopls semantic tokens via automation Jun 1, 2021
@stamblerre
Copy link
Contributor

stamblerre commented Jun 1, 2021

See #45753 for the semantic tokens for formatting verbs--we will work on addressing that soon. And you can get the old implementation back by setting:

"gopls": {
	"ui.semanticTokens": false
}

@stamblerre
Copy link
Contributor

Duplicate of #45753

@stamblerre stamblerre marked this as a duplicate of #45753 Jun 4, 2021
gopls semantic tokens automation moved this from To Do to Done Jun 4, 2021
@stamblerre stamblerre removed this from the gopls/unplanned milestone Jun 4, 2021
@golang golang locked and limited conversation to collaborators Jun 4, 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
No open projects
Development

No branches or pull requests

3 participants