Repository navigation
Add embedded language syntax highlighting support - #1180
Open
angelozerr wants to merge 1 commit into
Open
angelozerr wants to merge 1 commit into
angelozerr wants to merge 1 commit into
Conversation
Add xml.embeddedLanguages setting and TextMate grammar resolution for embedded language syntax highlighting in XML files. - Add xml.embeddedLanguages setting with DocumentMatcher + expressions - Add xml.textMateGrammar command to resolve grammar paths from installed VS Code extensions (e.g., built-in Groovy, Java, SQL) - Add settings enrichment to inject grammarPath before sending to lemminx - Expressions use xpath + languageId; grammarPath resolved automatically - Add documentation for embedded languages and semantic tokens features Signed-off-by: azerr <azerr@redhat.com>
|
Hi Angelo, a few small things about the doc:
|
Contributor
Author
|
Thanks @MeherSru To be honest with you, it is just a POC. Thanks for your feedback, I need to check your feedback. |
Contributor
|
Tried it out with a fake xhtml document. I used this for my settings: "xml.embeddedLanguages": [
{
"pattern": "**/*.xml",
"expressions": [
{
"languageId": "javascript",
"xpath": "/html/script/text()"
}
]
}
]I get the highlighting, but noticed that the colours are different from a standard JavaScript file. I think this is because semantic token colours are highlighted differently than their regular TextMate scope counterparts. I don't think there's much we can do about this, since we can only set the token type and don't have control over what the theme chooses to colour those tokens.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR requires eclipse-lemminx/lemminx#1881
Add xml.embeddedLanguages setting and TextMate grammar resolution for embedded language syntax highlighting in XML files.