-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update GDScript highlighting for Godot 4 #3901
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
base: master
Are you sure you want to change the base?
Conversation
|
I would rather keep old keywords around because someone could be editing code written for an old Godot version. |
|
Finally got around to fixing this. I
|
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 tested with two GDScript files I found on Github:
Triple quoted strings are missing handling for escaped characters, and I think it would make sense to make triple quoted strings into strings rather than comments (the documentation no longer mentions triple quoted strings as a way to create comments).
Other than that everything seems to look good.
| - statement.meta: "@[A-Za-z_][A-Za-z0-9_]*\\b" | ||
| # Keywords | ||
| - statement: "\\b(and|as|assert|await|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|get|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|set|setget|slave|slavesync|signal|sync|tool|var|while|yield)\\b" | ||
| - statement: "\\b(and|as|assert|await|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|get|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|set|setget|slave|slavesync|signal|static|super|sync|tool|var|when|while|yield)\\b" |
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.
| - statement: "\\b(and|as|assert|await|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|get|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|set|setget|slave|slavesync|signal|static|super|sync|tool|var|when|while|yield)\\b" | |
| - statement: "\\b(and|as|assert|await|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|get|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|set|setget|slave|slavesync|signal|static|super|sync|tool|var|void|when|while|yield)\\b" |
I'm sorry for missing this last time (copy-paste error)
| - constant: "\\b[0-9]+\\b" | ||
| - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'" | ||
| - constant.number: "-?\\b([0-9]?\\.[0-9]+|[0-9]+|0x[0-9a-fA-F]*)(e-?[0-9]+)?\\b" |
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.
The constant one can be removed since it's included in constant.number now.
This removes
exportand related keywords from the list of keywords and adds a new rule for highlighting annotations