-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Autocomplete sometimes places undesired quotes #86488
Comments
Tested on Godot v4.3.dev (13a0d6e) - Windows 10.0.22621 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.4601) - 12th Gen Intel(R) Core(TM) i7-12700F (20 Threads) Open the mrp and I did not reproduce this issue, seems like maybe there's other conditions for this bug to appear |
It seemes that because the InputEvent completion is hard code to return as constant with quotes. |
The added quotes are correct, it seems it doesn't handle the existing quotes correctly, or adds them twice, otherwise the result when not typing anything before requesting would be |
Can't replicate this without the LSP so can't test it properly unfortunately |
You need two vscode projects godot and godot-tools to test it. I have test it out. and find three confuse questions above. If I simple make I don't know how |
It's probably not the complete solution, but I have some ideas, if I can set up LSP I can test them out when I find the time I think instead this line should be changed:
To: item.insertText = item.label.unquote().quote(quote_style); As is done elsewhere |
Just want to make it known that this bug also happens with |
I have make my try to fix it. https://github.com/kaluluosi/godot/actions/runs/7628380270 I referred to @AThousandShips's suggestion to judge and clean up the quotes for specific kinds in the I also noticed that the triggerCharacters for LSP didn't include "(", which caused VSCode's "(" to not trigger completion, so I added it. This is the test: test-2.mp4test-1.mp4FinallyI think the LSP Server shouldn't include editor Preferences behavior in its response results, it should be more pure. Whether to insert parentheses after the method and whether to automatically close the parentheses should be editor behavior. But because GodotScript's LSP gets the data processed by Godot Script Editor, it inevitably brings in the inserted values processed by the editor. So now in And the GDScript LSP is so complex. 😂 Based on my research and observation, I understand why the The key function for a method of an instance variable within a script to pop up its parameter autocomplete is this: Line 950 in 74c32fa
However, this function will only be called by the Godot Script Editor if the following conditions are met:
Since the method's parameter variable is static during editing, it will not execute inside, so the parameter variable However, in order to obtain the development experience, we have to hard code the addition of the godot/modules/gdscript/gdscript_editor.cpp Lines 2716 to 2730 in 0bcc0e9
The purpose of That's about it.
I'm wrong, sorry. It actually need to visit scene tree. 😢 Lines 3102 to 3113 in 74c32fa
|
In my PR version it is fine. Clipchamp.mp4You can download my PR version Godot Editor artifact. Here is the link to access the artifact: link goes here. |
Perhaps I'm just not seeing the download link correctly, but it looks like the artifacts are expired and can't be downloaded anymore: Also, in your video, I'm noting that none of the names you have it autocomplete have spaces in them. From what I've seen this seems to be a problem when there are spaces in the name, and as a result the language server inserts quotes around its suggestion. Here's a video demonstrating this: godot.language.server.bug.-.double.quotes.mp4 |
Hmm... it looks like the artifact build has expired, so you'll have to check out my branch and build it yourself. |
I just tested the branch you linked, and it looks like it still has the same problem as shown in the video above. godot.language.server.bug.-.double.quotes.on.fix.branch.mp4 |
The suggestion of quote seems not provided by Godot LSP. Godot LSP not remember what you typed before. The quote one look like the VSCode's record. |
Should a new issue be opened on the Godot VS Code extension repository then? |
I've got one open here: godotengine/godot-vscode-plugin#644 |
Not sure if this is the right issue to ask this, but... I wish there was a setting for Godot's LSP to never add any extra parentheses, quotes or any other symbol when accepting auto-completion suggestion of a word. If I selected a word, I want to add just the word. Reasons from godotengine/godot-vscode-plugin#152 (comment):
|
Sounds like a different issue to me. |
Tested versions
v4.2.1.stable.official [b09f793]
System information
Godot v4.2.1.stable - Linux Mint 21.2 (Victoria) - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1080 (nvidia; 535.129.03) - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)
Issue description
Autocomplete includes unnecessary quotes when using
event
fromfunc _input(event)
andload()
. #81833 partially fixed autocomplete quotes reported in #48436 (as demonstrated in video below), but it still happens in this scenario with_input
andload()
(load()
example not shown).Steps to reproduce
Ignore line 9, was just experimenting.
2023-12-16.19-41-00.webm
Minimal reproduction project (MRP)
bugPOC.zip
The text was updated successfully, but these errors were encountered: