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

Add 'label' to set of semantic tokens for Go #3165

Open
adonovan opened this issue Feb 7, 2024 · 1 comment
Open

Add 'label' to set of semantic tokens for Go #3165

adonovan opened this issue Feb 7, 2024 · 1 comment
Labels
upstream-dependency Issues that are caused by bugs in the extension's dependencies.

Comments

@adonovan
Copy link
Member

adonovan commented Feb 7, 2024

https://go.dev/cl/562244 adds support to gopls for classifying control labels as a semantic token class ("label"). Strangely, given that JavaScript uses labels just the same way as Go in break and continue, "label" does not appear to be an LSP 3.17 standard semantic token type.

I think the VS Code Go extension should define "label" as a supported token type, and register a unique CSS class for it, ideally with light and dark styles. Here's the logic to register 'enumMember' as a semantic token for TypeScript:

This document suggests that VS Code already supports "label", so perhaps there is less to do: https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers

@pjweinb

@gopherbot gopherbot added this to the Untriaged milestone Feb 7, 2024
@hyangah
Copy link
Contributor

hyangah commented Feb 7, 2024

Filed microsoft/vscode-languageserver-node#1422
This is done by the LSP client library. I wish they could sneak this into the library without requiring us to wait for 3.18 LSP release.

@hyangah hyangah modified the milestones: Untriaged, vscode-go/backlog Feb 7, 2024
@hyangah hyangah added the upstream-dependency Issues that are caused by bugs in the extension's dependencies. label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream-dependency Issues that are caused by bugs in the extension's dependencies.
Projects
None yet
Development

No branches or pull requests

3 participants