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

Non-semantic highlighting #14

Open
2 tasks
KubaP opened this issue Dec 16, 2023 · 0 comments
Open
2 tasks

Non-semantic highlighting #14

KubaP opened this issue Dec 16, 2023 · 0 comments
Labels
a-Client Relating to the vscode client c-Feature Feature request/suggestion l-GL450/460 Relating to syntax or semantics for GL 4.50/4.60

Comments

@KubaP
Copy link
Owner

KubaP commented Dec 16, 2023

The VS Code client already supports semantic highlighting information received from the server, but semantic highlighting is only available "in context", which basically means within an editor/project that the server is operating on. Everywhere else, only non-semantic highlighting using TextMate grammars is used:

  • Within the hover/documentation widget.
  • Within markdown code blocks.
  • Within the diff viewer.
  • Many more such places...

TextMate grammar rules are a bit of a clusterfuck; the "standard" tokens are very precise in some areas but very imprecise in others. Plus, there really is no standard either, though it seems most editors and themes have settled on some common tokens. Given the complexity of writing regex rules to tokenize a non-trivial programming language, I think it's probably best to steal an existing TextMate grammar definition for a language like C and then modify it to work with GLSL.

Some potentially useful references:

Tasks

  • TextMate grammar rules.
  • TextMate markdown grammar injection.
@KubaP KubaP added this to glsl-lsp Dec 16, 2023
@KubaP KubaP converted this from a draft issue Dec 16, 2023
@KubaP KubaP added the c-Feature Feature request/suggestion label Dec 17, 2023
@KubaP KubaP added a-Client Relating to the vscode client l-GL450/460 Relating to syntax or semantics for GL 4.50/4.60 labels Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-Client Relating to the vscode client c-Feature Feature request/suggestion l-GL450/460 Relating to syntax or semantics for GL 4.50/4.60
Projects
Status: Todo
Development

No branches or pull requests

1 participant