Skip to content

Conversation

@yotam-frid
Copy link

@yotam-frid yotam-frid commented Aug 27, 2025

This branch marks the true/false/null consts as language literal constants to mimic the behavior of the engine editor which treats them as such.

Before: both true/false and Vector2.RIGHT treated as same level
image

After: booleans are in a separate scope (correct behavior)
image

@DaelonSuzuka
Copy link
Collaborator

What are your screenshots supposed to be demonstrating?

I'm fairly certain that true/false/null are being categorized the way I want them to be, so you're going to need to a better reason than this.

@yotam-frid
Copy link
Author

yotam-frid commented Aug 27, 2025

What are your screenshots supposed to be demonstrating?

I'm fairly certain that true/false/null are being categorized the way I want them to be, so you're going to need to a better reason than this.

Currently, true/false/null are treated as any normal constant. Regular consts are user-definable, but using true/false/null as a constant name is a no-op in GDScript, since they are reserved language keywords.

This PR doesn't change the classification from "constant", just more specificity: "constant literal". This creates a more accurate classification that aligns behavior with the default Godot script editor, which treats these constants as keywords, not constants:
image
(this is inside Godot, not vscode)

In the original PR screenshots (that are from inside vscode), note how Vector2.RIGHT and true or false are colored differently. This was not possible before.

@yotam-frid yotam-frid changed the title textmate: add true/false/null to language keywords scope textmate rules: reclassify true/false/null as literal constants Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants