Skip to content

Enhance GDScript syntax highlighting rules#76

Open
Dev-Sharbel wants to merge 4 commits intoGDQuest:mainfrom
Dev-Sharbel:patch-1
Open

Enhance GDScript syntax highlighting rules#76
Dev-Sharbel wants to merge 4 commits intoGDQuest:mainfrom
Dev-Sharbel:patch-1

Conversation

@Dev-Sharbel
Copy link

Refined Scope Mappings: Grouped keywords like var, const, if, for, setget, and @export under appropriate standard scopes (@Keyword.storage, @keyword.control, @Attribute).

Parameter Scoping: Function and lambda parameters now use the specific @variable.parameter scope, separating them from general local variables.

Literal Consistency: null, true, false, PI, TAU, etc., are correctly grouped under @constant.builtin.

Comment Annotations: Added specific regex matches for comment keywords (TODO, FIXME, ALERT, NOTE) using standard @error, @warning, and @info scopes.

(Articulated this description with AI)

Please check if the PR fulfills these requirements:

  • The commit message follows our guidelines.
  • For bug fixes and features:
    • You tested the changes.

Related issue (if applicable): #

What kind of change does this PR introduce?
Makes syntax highlighting more diverse. A ton of keywords were just under '@Keyword'. I discovered that when trying to customize a theme, leading to this.

Does this PR introduce a breaking change?
Not really

New feature or change

Spread all the keywords generically grouped under '@Keyword' into their appropriate categories, allowing deeper theme customization.

What is the current behavior?
A ton of words are just under '@Keyword', so when you try to overwrite a theme in Zed when working with GDScript, you'll discover that one color change dominates the screen.

What is the new behavior?

Other information
This is my first pull request, and I did not test things out because I am unable to download the GBs worth of requirements I discovered I need to compile the cloned repo and test it as a local extension (in Zed: Install Dev Extension). My WiFi's bandwidth is very slow atm. (Needed to download 4~6 GBs from Visual Studio Installer)

I hope this can be considered, to make the user experience better when using Zed x Godot.

Thank you for this amazing extension, and for being my first first Godot tutor! (This is not a flattery bribe, cough cough xd - 🥺)

Refined Scope Mappings: Grouped keywords like var, const, if, for, setget, and @export under appropriate standard scopes (@Keyword.storage, @keyword.control, @Attribute).

Parameter Scoping: Function and lambda parameters now use the specific @variable.parameter scope, separating them from general local variables.

Literal Consistency: null, true, false, PI, TAU, etc., are correctly grouped under @constant.builtin.

Comment Annotations: Added specific regex matches for comment keywords (TODO, FIXME, ALERT, NOTE) using standard @error, @warning, and @info scopes.

(Articulated this description with AI)
@Dev-Sharbel
Copy link
Author

Dev-Sharbel commented Feb 2, 2026

I have downloaded the requirements to compile and run the repo locally, and am now testing everything. Will post again afterwards.

diversified some keywords and changed the type of other to better
reflect what Godot uses
@Dev-Sharbel
Copy link
Author

Dev-Sharbel commented Feb 3, 2026

Hey, everything works fine now.

And I have further diversified stuff, allowing greater customization.

I've tagged things (this to @keyword.control, that to @Attribute, etc. etc.) in accordance with Godot's way of theming things (editor settings, script editor appearance) and following standard practices (such as adding function definition under @function.definition)

I'll keep working on it tomorrow

@NathanLovato
Copy link
Contributor

Thank you very much for taking the time to contribute here and to test your changes. It's much appreciated!

Just so you know, I'm on vacation for the first time in a long time, so I won't review and merge this this week, but I'll do my best to get to it next week.

@Dev-Sharbel
Copy link
Author

Hey, thank you for replying!

No worries, take your time and happy vacations! I'll take this time to polish it some more!

@Dev-Sharbel
Copy link
Author

update to those reading in the future: You can navigate to %appdata%zed\extensions\installed to find gdscript, then go into languages\gdscript and you can edit the highlight.scm in there for a 'hot reload' effect, seeing your changes reflected directly.

I only discovered this after spending a lot of time downloading rustup and its requirements to build locally and test things haha.

diversified strings (StringName, NodePath, etc.), but there is no way to
color formatters like %s without coloring the entire string, so left
that out.

fixed variable names only coloring in declaration and not statements.
Added a catchall at the top for that matching to @variable, doing
similar work to godot's text color.

added colon to operator list for consistency when static typing

changed self and super to standard variable.language
updated function_definition, now parameters, both typed and untyped will
colored, in normal function definitions and in lambdas.
@Dev-Sharbel
Copy link
Author

Dev-Sharbel commented Feb 5, 2026

I just realized I was pushing from another account, ugh ~

I'm sorry about this, I'm switching from now on to my correct account (the one I was committing from, @Fuzzycc )

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.

3 participants