Skip to content

Fix embedded languages not displaying correctly - #99

Merged
nefrob merged 6 commits into
nefrob:mainfrom
nikitalita:fix-embedded-languages
Mar 22, 2026
Merged

Fix embedded languages not displaying correctly#99
nefrob merged 6 commits into
nefrob:mainfrom
nikitalita:fix-embedded-languages

Conversation

@nikitalita

Copy link
Copy Markdown
Contributor

Description:

If you have embedded languages in the grammar you're providing, you need to provide an "embeddedLanguages" parameter in the "grammars" object with "<tm_id>": "<LANG>"; otherwise they won't display correctly in vscode.

Additionally, there were errors in the bounds-checking of embedded-language in the tmLanguage. If a subsequent recipe had any deps or params in the specifier, the end check would fail and the syntax coloring would bleed into the subsequent lins. I updated the tmLanguage to properly mark the "end" bound.

Finally, I updated the tests to correctly embed the embedded grammars in the snapshots. Please note: there were a bunch of tmLanguage files added in syntaxes/test-grammars to accomodate testing; this is only for testing, these are NOT used when the extension is running.

Testing/Screenshots:

Before:
image

After:
image

@nefrob
nefrob self-requested a review March 18, 2026 14:40

@nefrob nefrob left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thanks for digging into this long standing setup issue. Snaps look good.

Comment thread syntaxes/test-grammars/JavaScript.tmLanguage.json
@nikitalita

Copy link
Copy Markdown
Contributor Author

Done

@nefrob
nefrob merged commit f71d9d5 into nefrob:main Mar 22, 2026
1 check passed
@nefrob

nefrob commented Mar 22, 2026

Copy link
Copy Markdown
Owner

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

Successfully merging this pull request may close these issues.

2 participants