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

Semantic Tokens from LSP are not recognized and not colored #821

Open
jnt0r opened this issue Sep 23, 2023 · 4 comments
Open

Semantic Tokens from LSP are not recognized and not colored #821

jnt0r opened this issue Sep 23, 2023 · 4 comments

Comments

@jnt0r
Copy link
Contributor

jnt0r commented Sep 23, 2023

Following the discussion in #274 I create this issue.

Semantic tokens received from the language server are not recognised and mapped to an appropriate colour. Therefore, the files remain black and white without any additional TextMate grammar.

By manually defining a theme that maps the LSP tokens to appropriate colours, the files will appear coloured. This should not be done by the developer of a plugin, but rather in lsp4e.

My first approach would be to map the LSP tokens to the corresponding tokens in eclipse. This way it is possible to change the colours by changing the active theme. Otherwise this would not be possible by defining static colours for a token.

Is there a list of supported token names in Eclipse?
What is the minimum set of tokens that each theme needs to define?
What other approaches might we discuss?

@jnt0r
Copy link
Contributor Author

jnt0r commented Oct 19, 2023

Are there any "default" token names in Eclipse that every theme has to implement?
So we could do a mapping from LSP token names to eclipse token names?
With that solution it would be possible to use the user specific theme colors of the user instead of static colors defined in plugin.

@mickaelistria
Copy link
Contributor

My first approach would be to map the LSP tokens to the corresponding tokens in eclipse. This way it is possible to change the colours by changing the active theme. Otherwise this would not be possible by defining static colours for a token.
Is there a list of supported token names in Eclipse?

I think it's the good approach. However, please keep in mind that the tokens are not defined in Eclipse, but here they would be defined in the TextMate themes.
TextMate themes use relatively universal conventions for tokens, so mapping the LSP4E semantic tokens type to TextMate tokens should be sustainable enough.

Please see example themes https://github.com/eclipse/tm4e/tree/main/org.eclipse.tm4e.ui/themes to see what are the usual tokens defined in a TextMate grammar and evaluate how LSP4E SemanticTokens can be mapped there.

@deanmaster
Copy link

hi @mickaelistria
does this means ,we support semantictoken ? I would vote for any default theme color comes with Eclipse without any adjustment. This would make sure the highlighiting keywords are working for IDEs.

@rubenporras
Copy link
Contributor

Supporting semantic highlight when TextMate is not configured to provide colors for an editor would require a configuration option because currently LSP4E is a participant on reconciliation initiated by TexMate and I do not think we can detect that TextMate is not used so that we start our own reconciliation.

If TextMate is configured to provide colors for an editor, it provides already highlight for keywords, and LSP4E would use that highlight as well, I think that is good enough.

Or is this not working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants