Improve highlighting around self/super#91
Open
YuriSizov wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please check if the PR fulfills these requirements:
What kind of change does this PR introduce?
This changeset improves highlighting for special GDScript identifiers
superandself, at least for the cases now added to the test script. Previous implementation was unsatisfactory in terms of catching some of these cases, and on top of that, since #76, the highlighting was using a tag not present in current Zed themes, at least official ones (@variable.language).As an extra, this change moves highlighting for
base_callfrom@function.builtinto the basic@function.method. Base calls aren't really any different from method calls, and the built-in highlighting is better reserved for things likesuperhere.Also, I don't think it's possible to get
base_callfrom the tree-sitter here, since it targets specifically the Godot 3 version of these calls, beforesuperwas introduced. I wasn't able to find a way to get it at least. Here's an example from the tree-sitter docs, and this syntax is invalid in Godot 4's version of GDScript:PS. I've made these changes some weeks ago at this point, so memory is a bit murky about their completeness. But I've been using my local dev version of the extension this whole time and that's probably sufficient testing.