zed-gdscript icon indicating copy to clipboard operation
zed-gdscript copied to clipboard

Wrong auto completion with Input action names.

Open gro-david opened this issue 1 year ago • 2 comments

I'm submitting a...

  • [x] Bug report.
  • [ ] Feature request.

Bug report

What is the current behavior? When using Input.get_action_pressed() and similar functions, you need to type the name of the action as a string. If you start typing it the auto completion starts suggesting the correct action names, but with quotes. To trigger the autocomplete you still need to start a string either with double or single quotes, the resulting behavior is the same.

What is the expected behavior? The auto completion should either start, without needing quotes to get triggered or the suggested completions should not include quotes.

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem. Type the function Input.is_action_pressed(. Then you will need to start a string with either the single or the double quotes. Finally start typing the name of an action (eg. (ui_accept) and accept the auto completion. this will result in you having either '"ui_accept"' or ""ui_accept"" instead of either 'ui_accept' or "ui_accept".

gro-david avatar Oct 19 '24 08:10 gro-david

Thank you for pointing this out! I still have had very little time to dive into how Zed works so I don't know why this might be happening. If anyone knows and beats me to figuring it out, help would be much appreciated.

NathanLovato avatar Oct 24 '24 17:10 NathanLovato

It's a limit of the language server, see https://github.com/godotengine/godot/issues/86488

To fix it we need to calculate the insertion on the server side, otherwise the option is up to arbitrary client interpretation which is currently only working correctly with Godots builtin insertion algorithm. Most other editors behave differently.

You can get the completion without typing the quotes, but you need to trigger completion manually since we don't set ( as completion trigger character. Adding it does not really make sense, since you will need the quotes if trying to filter through the options anyway. Also zed doesn't seem to trigger completion for trigger characters inserted by auto completion. So it would be useless anyway in most cases.

HolonProduction avatar Jul 08 '25 09:07 HolonProduction