-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
LSP: Fix autocomplete quote handling #81833
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
It seems fine to me! I tested it and it works.
And thank you for this first contribution. It's clean and does the job. Good job!
Don't hesitate to join the developer chat, especially if you want to continue contributing to Godot! Happy to see you there!
Please squash your commits into one, see here |
27d3146
to
2db11c1
Compare
I've squashed the revisions to |
No need for two different commits here, the changes aren't significant enough |
Typing a single or double quote in an external editor triggers auto-completion. The returned CompletionItem should not include quotes since they're already in the editor. CompletionParams was missing context in to_json() and this is required to detect whether a quote was typed.
2db11c1
to
7ea4247
Compare
Thanks! And congrats for your first merged Godot contribution 🎉 |
Hello, I'm a noob when it comes to this kind of stuff, but I was wondering if this fix is going to be merged into Godot 3.5 LTS? Just started working with Godot and I've noticed this bug present in the current 3.5.3 LTS version. Thanks! |
Cherry-picked for 4.1.3. |
Fixes #48436
Updates to language server:
I'm new to Godot and C++, but after poking around the code base a bit, I was able to get it working by making two changes:
context
member. It provided an implementation forload()
to include that data, but not one forto_json()
. Socontext
was missing from the JSON and there's already code inGDScriptTextDocument::resolve()
that depends on that. I addedcontext
to the JSON so it can be used inresolve()
.resolve()
has the context, the current bug can be fixed. If the completion was triggered with a single or double quote, then there's already a quote (or a pair of quotes) in the external editor. The auto-complete suggestion should be returned without quotes.Both changes are in language server classes, so this change should not break the built-in editor. I did a quick test to confirm that still returns quotes.
Again, I'm new to Godot and C++, so if I'm overlooking something obvious, please let me know and I'll try to fix it.