Skip to content

Update GDScript $ node reference tokenization #845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

YofiAsi
Copy link
Contributor

@YofiAsi YofiAsi commented Apr 11, 2025

Issue
In the current TextMate grammar for GDScript, the $ symbol used for node references (e.g., $Label) is incorrectly tokenized as keyword.control.flow.gdscript. This causes the symbol to be highlighted with the same color as flow control keywords like if and while, which is semantically incorrect.

Changes
This PR changes the tokenization of the $ node reference symbol from keyword.control.flow.gdscript to constant.character.escape.gdscript in all three relevant patterns:

  • builtin_get_node_shorthand_quoted
  • builtin_get_node_shorthand_bare
  • builtin_get_node_shorthand_bare_multi

Benefits

  • More semantically accurate token classification
  • Better visual distinction between flow control keywords and node references
  • Consistent highlighting for node path references in GDScript
  • Improves readability for developers using the VSCode extension

Testing
I've verified these changes with multiple color themes to ensure the highlighting is now consistent and appropriate for this language feature.

@DaelonSuzuka
Copy link
Collaborator

The highlighting of $ (and %) is not a mistake.

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.

2 participants