Skip to content

[codex] fix string highlighting after static assert#69

Merged
csyonghe merged 1 commit into
mainfrom
codex/fix-string-highlighting-after-static-assert
May 28, 2026
Merged

[codex] fix string highlighting after static assert#69
csyonghe merged 1 commit into
mainfrom
codex/fix-string-highlighting-after-static-assert

Conversation

@csyonghe

Copy link
Copy Markdown
Contributor

Summary

Fixes a Slang TextMate grammar leak where a quoted diagnostic string containing a qualified call-like token, such as _Texture::SampleCmpLevel(...), could cause subsequent code to remain highlighted as part of the string/meta scope.

Root Cause

The meta.qualified.type.call.slang lookahead could scan through quoted text after Shape.dimensions, find _Texture::SampleCmpLevel( inside the string literal, and incorrectly keep the qualified-call scope active. The string rules also had no end-of-line fallback, which made leaks more visible when a string scope failed to close cleanly.

Changes

  • Stop the qualified type-call lookahead at quote characters.
  • Let single and double quoted strings terminate at the closing quote or end of line.

Validation

  • Parsed syntaxes/slang.tmLanguage.json with ConvertFrom-Json.
  • Ran a VS Code TextMate tokenizer smoke test confirming the static_assert string closes, the following if is scoped as keyword.control.slang, escaped quotes still work, and unterminated strings do not leak into the next line.

@csyonghe csyonghe marked this pull request as ready for review May 28, 2026 22:57
@csyonghe csyonghe merged commit d32bd81 into main May 28, 2026
2 checks passed
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.

1 participant