Language Server using TextMate grammar for highlighting #2656
Unanswered
reteps
asked this question in
Extension Development QnA
Replies: 1 comment
-
atm the system for implementing embedded/injected languages is rather poor |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way for a language server for language Y to say "this embedded snippet is language X"
If a language server supports the Semantic Tokens API, but has an embedded language that doesn't support Semantic Tokens, it feels reasonable to allow the language server to use a textmate grammar in order to support syntax highlighting those embedded languages. The alternative is requiring the language server to provide a textmate grammar with support for the embedded language, and then overriding said grammar with the semantic grammar.
It feels like the accepted solution for this situation is request forwarding, but that happens on the Language Client side, and is specific to VSCode.
The other solution I saw was this,
Related:
microsoft/vscode#210475
https://github.com/vsce-toolroom/vscode-textmate-languageservice
https://github.com/microsoft/vscode-anycode/tree/main
Less related:
microsoft/vscode#165788
https://github.com/microsoft/vscode/wiki/Semantic-Highlighting-Overview/72389eecd11607827ec0e345dcd13c89745a3977#token-classification-to-textmate-scopes-list
#1034 (reply in thread)
microsoft/vscode-docker#4183
Beta Was this translation helpful? Give feedback.
All reactions