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

Fix various highlighting errors #407

Merged
merged 16 commits into from
Aug 21, 2022

Conversation

DaelonSuzuka
Copy link
Collaborator

@DaelonSuzuka DaelonSuzuka commented Aug 13, 2022

This PR will have a collection of syntax highlighting improvements, starting with issues outlined in #379,

  • in keyword

image

  • await and super

Code_rfH2Tv7ExD

  • get and set (harder)

Code_fffonCRmJX

  • @annotation syntax

I'm not sure if the list of "decorator" keywords is exhaustive, but the basic mechanism definitely works.

image

  • investigate other new Godot 4 features
  • lambdas

Code_uHjnckmxFp

  • type arrays

image

  • trait and namespace

@DaelonSuzuka DaelonSuzuka changed the title Fix in keyword Fix various highlighting errors Aug 13, 2022
@DaelonSuzuka DaelonSuzuka marked this pull request as ready for review August 18, 2022 22:06
@DaelonSuzuka
Copy link
Collaborator Author

@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 @annotations a more exotic color, but I actually think it looks fine like this.

@Calinou
Copy link
Member

Calinou commented Aug 21, 2022

Let me know if you hate any of my colorization choices. I was torn on giving @annotations a more exotic color, but I actually think it looks fine like this.

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
Copy link
Member

@Calinou Calinou Aug 21, 2022

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).

Copy link
Collaborator Author

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.

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!

We can change the annotation color in a future PR.

@Calinou Calinou merged commit dfe2319 into godotengine:master Aug 21, 2022
@DaelonSuzuka
Copy link
Collaborator Author

Does VS Code have a standard annotation color (e.g. the one used in Python, or for preprocessor keywords in C/C++)?

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.

@DaelonSuzuka DaelonSuzuka deleted the godot4-missing-syntax branch August 22, 2022 22:13
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