[JavaScript] Fix nested template strings#4566
Open
deathaxe wants to merge 2 commits into
Open
Conversation
This commit ... 1. renames existing syntax definitions to `<name> (Plain).sublime-syntax` 2. changes main scopes to `source.<name>.plain` 3. adjusts all references, accordingly
This commit... 1. adds new syntax definitions `<name>.sublime-syntax` which extend previously renamed `<name> (Plain).sublime-syntax` files. 2. moves file_extensions and first_line_match patterns to public syntaxes 3. moves `literal-string-template-<lang>` contexts to new syntaxes 4. refactors literal template strings to directly include embedded languages, which need to support nested literal strings. 5: adjust embedded syntaxes to include contexts with lookaheads to make sure to properly terminate parsing at template string end punctuation.
jrappen
approved these changes
Jun 21, 2026
Collaborator
|
I wasn't sure if adding explicit child scope match tests would make sense (requires 4201 or later), it'd work on the |
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.
Resolves #4220
This PR splits changes of #4318 into two initial commits to better track required changes to achieve proper handling of nested template strings.
Step 1:
Rename existing syntaxes to
<name> (Plain)and scopes tosource.<...>.plain. Adjust includes to keep everything working.Step 2:
Notes:
.plainvariants to prevent syntax highlighted template strings cause infinite include loops.