-
Notifications
You must be signed in to change notification settings - Fork 771
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
ui: enable semantic tokens by default #2286
Comments
There are a number of significant changes to the coloring of Go code when semantic tokens are turned on. We will need to make sure to have clear communication as we transition over to semantic tokens. A possible path forward would be to:
|
Closing since "gopls" "ui.semanticTokens" setting will go away. |
We learned the trick described in #2598 doesn't work. Reopening. |
I have been thinking about this recently. I think we should have two modes for semantic tokens.
(very open to better names: fast/rich?) The problems with the current implementation, that have always made me hesitant to advocate for it by default, are as follows:
Semantic tokens based on go tokenization / parsing doesn't suffer from any of these problems, though it is arguably not as useful. However, I think it could provide ~80% of the benefit, would be much more reliable, and frankly is the mode I would enable. Therefore, I think we should at least implement a syntax mode (it should be very easy to do), and I would argue that it should be the default. Furthermore, we can use this fast mode for files that don't have packages, even if the "types" highlighting is selected. |
We can set this default before gopls switches its default (golang/go#45313)
Semantic tokens fixes many issues TextMate-based syntax highlighting has (incorrect highlighting, lack of generics support, etc)
Potential concerns:
Setting:
Currently, we ask users to use
But how about promoting this as a go setting?
@golang/tools-team
The text was updated successfully, but these errors were encountered: