-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Fix various highlighting errors #407
Fix various highlighting errors #407
Conversation
@Calinou I couldn't find any other new GDScript features that were missing syntax highlighting. Let me know if you hate any of my colorization choices. I was torn on giving |
Does VS Code have a standard annotation color (e.g. the one used in Python, or for preprocessor keywords in C/C++)? |
@@ -0,0 +1,55 @@ | |||
extends Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be good idea to submit this code as a GDScript integration test in godotengine/godot 🙂
I can look into doing that (same for gdscript1.gd
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an ergonomic way to automate a highlighting test? I haven't been able to think of one that wouldn't be a massive pain to define the success/failure conditions.
I think finding a way to share test files with the engine is a great idea, though. Having files that we know exercise all of the compiler's features would really increase confidence that we're covering all the possible syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
We can change the annotation color in a future PR.
The current annotation color is the same as python's decorators. Godot's script editor colors the annotations like keywords, but I thought that didn't look quite as good here. C/C++ preprocessor things are mostly just blue like keywords, as far as I remember. I know rust has some complicated syntax, I can see what they do for meta-informational markings like this. C# and C++ might also have something similar. |
This PR will have a collection of syntax highlighting improvements, starting with issues outlined in #379,
in
keywordawait
andsuper
get
andset
(harder)@annotation
syntaxI'm not sure if the list of "decorator" keywords is exhaustive, but the basic mechanism definitely works.
trait
andnamespace