vscode-go
vscode-go copied to clipboard
syntax highlight: strange code colorization in nightly extension
When try to test dlv-dap, I update vscode-go extension from stable to nightly, but found code colorization strange on vars and func names. vacode version:
Version: 1.57.0-insider (user setup)
Commit: fe23c2041f848d6c2f6bd27875112a37bcc82f84
Date: 2021-05-06T05:16:25.564Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.21370
origin vscode-go:
version: v0.24.2
screenshot:

nightly
version:``
screenshot:

is this change of green color by design?
Thanks for the report. Can you please share your settings (anything involving "gopls" and "editor.semanticHighlighting.*" and theme setup), and the gopls trace captured following the instruction? I suspect gopls's semantic token is enabled automatically in the nightly.
@stamblerre told me that semantic toke is enabled in Nightly by default. I verified it too. @zzjin You can disable this feature explicitly by configuring in settings.json.
"gopls": {
"ui.semanticTokens": false
}
But we are currently experimenting this new feature and looking for feedback. Do you think this color change is undesirable or distracting? What do you think?
@hyangah thanks for response. setting ui.semanticTokens false rebase normal.
I use vscode's default dark theme and not set any other semanticHighlighting settings.
IMO, the new semanticTokens changes some 'same color for same mean' behavior: (just example)
- import path string is in double quote, but last path is not as same color as prefix path. (as shown below)
- funcs are yellow, but struct impl func are green:

Yeah, we are still unclear how themes and vscode assign colors for tokens yet.
cc @pjweinb
The change in color for the last component of an import is intended. If the code says import "a/b/c" then uses of the package look like c.fn() That is, the coloring shows the namespace of the import.
I actually love ui.semanticTokens, especially that packages now have a different color vs vars, but there are definitely a few weird colorings.
Adding to what was already mentioned above, nil now has the color of variables, when using the default Dark+ theme but on the other hand many color themes don't support the coloring of theme package name in the import