LSP-clangd icon indicating copy to clipboard operation
LSP-clangd copied to clipboard

Feature Request: Custom semantic selectors for global & block scoped variables

Open leximayfield opened this issue 1 year ago • 1 comments

There is a specific feature that I am taking advantage of in Visual Studio 2022 that I would very much like to replicate in Sublime Text.

In Visual C++ 2022, I have set up my color scheme to where block-scoped variables are red, class/struct member variables are light red, and global variables are white. With your plugin, I can get the proper color on class/struct members using the meta.semantic-token.property selector, but it does not appear that there is a more specific semantic selector than meta.semantic-token.variable for other types of variables.

Would it be possible to add a meta.semantic-token.variable.global and/or meta.semantic-token.variable.block selector?

leximayfield avatar Aug 24 '24 23:08 leximayfield

The semantic token types are defined by the LSP specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens

And the LSP plugin should support all of them. See https://lsp.sublimetext.io/customization/#semantic-highlighting

This plugin is a bridge to clangd where this need to be implemented. There is already an open issue for more semantic tokens: https://github.com/clangd/clangd/issues/1115

LDAP avatar Aug 26 '24 08:08 LDAP