This repository was archived by the owner on Nov 21, 2025. It is now read-only.
fix(syntaxes): variable token for @let binding
#2160
Merged
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 tweaks the TM scopes applied to
@letdeclarations to tokenize the bound identifier as a variable. This brings the grammar into closer alignment with, e.g., TypeScript's TM grammar.Changes made
variable.other.constant.ng.meta.definition.variable.ngscope now covers the entire declaration instead of just the identifier and the initializer expression.Screenshots
Before:
After:
Note
I went with
variable.other.constant.nginstead ofvariable.other.readwrite.ngbecause it's technically correct (you cannot reassign a@letbinding), but it does make it inconsistent with the rest of the grammar, which usesreadwriteeverywhere. I'd be happy to change it if there's a preference for consistency over correctness. My daily driver theme (and likely most themes on the marketplace) doesn't distinguish between the two, but the default VS Code theme renders constants with a slightly different shade of blue.