-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
GDScript 2.0 (again) #40598
GDScript 2.0 (again) #40598
Conversation
Sometimes to fix something you have to break it first. This get GDScript mostly working with the new tokenizer and parser but a lot of things isn't working yet. It compiles and it's usable, and that should be enough for now. Don't worry: other huge commits will come after this.
Also improve error for unknown characters.
Also store Variant operator to avoid needing to do it repeatedly in later compiling stages.
Reenable checking those when validating code.
This naturally needs extensive testing and possibly some more code review, but let's merge already to get a wide testing coverage from users of the |
Thanks! |
Weren't we going rename this to GDScript 4.0 to better signify that it's for 4.0? Or was it just some suggestion by someone and was rejected? |
This is just a title for this PR, we don't have an explicit GDScript version number (or you can say that it follows the Godot version). |
Yet we have NativeScript 1.1. |
I have two questions/suggestions regarding the expanded use of StringName:
|
@vnen I'm working on completion for calls and I don't understand the purpose of: godot/modules/gdscript/gdscript_parser.h Line 1043 in 494bf38
It's the completion_context type when the cursor is in this spot print(|) , which makes it weird that it should "List available methods in scope". No completion is implemented for COMPLETION_METHOD right now. Can you explain?
I hope it's okay that I ask here, I did because of git blame. |
@gvekan if the comment contradicts the code then trust the code. This was likely an oversight when I added it since I started with the previous code and it might've worked that way before. Feel free to change it (I don't think that listing methods in scope is relevant because those are usually part of the list of identifiers, so there's not really much use for this kind of completion). Also, you can open issues and mention me to avoid cluttering this merged PR. |
I'm implementing a GDScript lexer, and for reference looked at Godot's own tokenizer. In |
Yes, they were reserved beforehand with the plans of (eventually) implementing them. This just haven't been done yet. |
This one includes and complements the other PR: #39093. Most changes are outlined on that description.
All the things marked as "broken" there are now implemented. This includes type checks, code completion, warnings, language server (although I could not test this), and the mentioned optimizations (constant folding and avoiding allocating an array when
range
is used as afor
loop iterator).setget
is now replaced by properties, implemented as outlined in the proposal: godotengine/godot-proposals#844.I've tried to do a bunch of tests to find potential issues. I solved a lot of crashes and incorrect behavior along the way and this should be mostly stable. However I won't be surprised if someone can find other crash cases, or infinite loops (especially on completion), or wrong behavior. If you do, please report an issue and I'll solve it when possible.
There are still a lot to improve but this should be at the same level of what it was before (although I know completion is not super great yet, I intend to revisit the code and overall improve the detection and listing).