Skip to content
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

Add highlighting support for %Unique nodes in NodePaths #403

Merged
merged 5 commits into from
Aug 6, 2022

Conversation

DaelonSuzuka
Copy link
Collaborator

@DaelonSuzuka DaelonSuzuka commented Aug 5, 2022

This PR adds support for the new Scene Unique Node syntax in NodePaths.

The highlighting works in $"Shorthand" and in string arguments to common NodePath-using functions.

image

I added a bonus feature that highlights invalid Unique nodes inside bare shorthands as red, eg: $%Unique or $Child/%Unique, because as far as I could tell, that's not supported syntax. In my opinion, this is not the job of the syntax highlighter, but a quick test shows me that the error displayed from the LSP is not exactly helpful if you don't already understand the feature:

image

My hope is that the highlighting will help the adoption of %Unique nodes, and I can come back later and either remove this highlighting or re-implement it in a more appropriate place.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Calinou Calinou merged commit ec95c21 into godotengine:master Aug 6, 2022
@DaelonSuzuka DaelonSuzuka deleted the unique-node-support branch August 22, 2022 22:14
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.

2 participants