fix: adjust scope created within multiline string W-21968889 - #85
Merged
Merged
Conversation
Modify multiline string so it uses the same highlight scopes found in simple string
mshanemc
approved these changes
Apr 10, 2026
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.
Summary
Refines multiline string (
'''…''') highlighting and template interpolation for single-quoted strings only, with tests and regenerated grammars (Apex + SOQL + Atom cson).Multiline strings (
multiline-string-literal)'''(?=$)so the opening'''must sit at end of line (matches the intended “newline after opener” behavior under line-based tokenization).string.quoted.single.apex+string.quoted.single.multiline.apexso themes color MLS body like normal string text.#string-character-escape—#string-template-expressionis not included for MLS, so${…}is notmeta.template-expression; it uses the same string scopes as the rest of the MLS. Only backslash escapes getconstant.character.escape.apex.Simple strings (
string-literal— unchanged structure)(?<!\\)\$\{so\${…}is literal (escaped$), not a template opener.\G-anchored match supporting dotted names (e.g.${a.b}) without splitting on..Other
when-string:include#multiline-string-literalbefore#string-literalin the relevant capture groups so MLS is available alongside single-quoted strings where those patterns are used.Files
src/apex.tmLanguage.yml— grammar rules above.grammars/apex.tmLanguage,grammars/apex.tmLanguage.cson,grammars/soql.tmLanguage— rebuilt outputs.test/literals.test.ts— expectations for MLS (no template tokens inside'''…'''), escaped\$, dotted${a.b}in simple strings, and updated MLS fixtures for EOL'''opener.Verify
npm run build && npm test@W-21968889@