Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Conversation

@dannymcgee
Copy link
Contributor

@dannymcgee dannymcgee commented Mar 20, 2025

This PR tweaks the TM scopes applied to @let declarations to tokenize the bound identifier as a variable. This brings the grammar into closer alignment with, e.g., TypeScript's TM grammar.

Changes made

  • The bound identifier gets its own scope, variable.other.constant.ng.
  • meta.definition.variable.ng scope now covers the entire declaration instead of just the identifier and the initializer expression.

Screenshots

Before:

let-highlighting-before

After:

let-highlighting-after

Note

I went with variable.other.constant.ng instead of variable.other.readwrite.ng because it's technically correct (you cannot reassign a @let binding), but it does make it inconsistent with the rest of the grammar, which uses readwrite everywhere. 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.

@atscott atscott merged commit 0aa2aa5 into angular:main Mar 28, 2025
4 of 5 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants