-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve the pygments lexer to cover GDScript 2 better #11217
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
Improve the pygments lexer to cover GDScript 2 better #11217
Conversation
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.
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.
f1ddeff
to
eafb19b
Compare
singulars done, squashed everything, should be ready - let me know if anything else stands out to you |
eafb19b
to
6c5997c
Compare
85a8f8c
to
b5740a5
Compare
251b197
to
eca6d94
Compare
eca6d94
to
84b6484
Compare
84b6484
to
5ebeb22
Compare
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 did another test locally and it looks great. Code looks good to me.
# copied from https://docs.godotengine.org/en/stable/classes/index.html | ||
( | ||
words( | ||
( | ||
# Nodes | ||
"Node", | ||
"AcceptDialog", | ||
"AnimatableBody2D", | ||
"AnimatableBody3D", |
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 have concerns about this. It feels like this will grow out of date quickly and would need constant updates. If there is any way at all to automate this part, I'd appreciate it.
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.
While I agree automation would be nice (and I'll have a look into it), realistically I don't think this going out of date is much of an issue because
- The most important classes have had the same name since 4.x, they aren't renamed particularly often.
- New classes are rarely added to the docs right away
- Classes are rarely removed between major updates too
- If there are any outdated classes, the hue will only be off slightly
- And considering all of that together, the benefit of covering most of the important classes far outweighs risking missing a few less important ones
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.
Those are some fair points. :) Maybe we can make grabbing the list from that URL during the build a future todo then, and see how it goes.
Thanks for working on this! Overall it looks quite good to me, besides the single concern noted above. |
Thank you! Merged. |
Cherry-picked for 4.5. |
we've recently updated the gdscript lexer for our own documentation, this is a port of those changes to fit the godot docs
please check as many pages as you can for errors i might have missed.
also let me know if the colors are fine like this. i think some of the existing colors may be from an older theme and not quite up to date, but i didn't touch them for now.
main changes are functions having proper blue color now, global functions being purple, all classes getting the correct greens (including builtins and types having the different green), and proper colors for $String, string names and node paths