Skip to content
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

Close bracket is not generated when autocomplete #152

Closed
tienlocnguyen opened this issue Feb 26, 2020 · 9 comments
Closed

Close bracket is not generated when autocomplete #152

tienlocnguyen opened this issue Feb 26, 2020 · 9 comments
Labels
bug confirmed language server Issue is not originating from this extension, but from the LSP instead

Comments

@tienlocnguyen
Copy link

tienlocnguyen commented Feb 26, 2020

Only open bracket is generated, closed bracket is not
Peek 2020-02-26 20-21
Expect that close bracket will be generated too

@colludium
Copy link

Any update on this please? Thanks.

@atirut-w
Copy link

This is a very annoying issue but I've somehow forgotten about it. Maybe @DaelonSuzuka can fix this?

@Calinou
Copy link
Member

Calinou commented Apr 30, 2022

Related to #142.

@DaelonSuzuka
Copy link
Collaborator

@atirut-w @Calinou Fixing this in the Language Server is a bit beyond my expertise at the moment. There are a number of other issues with both the Server(at least in 3.x) and the Client that I will eventually be addressing, but it's very complex system and that's going to take some time.

Luckily, I think there's a quick and dirty solution by just modifying the completions in the Client based on the context around the cursor/selection. If I have time this week, I'll try to put together a proof of concept.

@DaelonSuzuka DaelonSuzuka added the language server Issue is not originating from this extension, but from the LSP instead label Feb 28, 2024
@geekley
Copy link

geekley commented Oct 22, 2024

Yes, this has been bothering me for quite a while.

Other languages in VSCode don't add any sort of parentheses on auto-completion, and this is what I expected for GDScript too. It's one of those things where doing too much automatically will be more trouble than help, and there's many reasons why:

  • I don't always want a ( after accepting function suggestion. Often I want to pass its callback, so you shouldn't assume I want the parentheses and make me have to delete it, even if calling happens more often.
  • Since it adds just a (, it makes the parentheses unbalanced.
  • It's more trouble to delete the extra unbalanced (. For example, accepting a suggestion for function bar in this code: pass_callback(bar(|) (where | is the cursor), pressing backspace I want to delete the extra ( only, but it deletes both (). This is why is better to not assume and "try to help" too much adding parentheses.
  • When I accept an auto-complete suggestion for a function, on other languages I type ( manually and automatically get the function signature popup without having to do CtrlShiftSpace. On GDScript, this doesn't happen, because it auto-fills the ( without triggering the parameter hints. So I still have to manually press MORE keys anyway (and add the closing ) afterwards).
  • Being inconsistent with the behavior in other languages in VSCode is also a reason by itself.

So, please add at least an option to just not add any parentheses automatically.

@DaelonSuzuka
Copy link
Collaborator

@geekley

So, please add at least an option to just not add any parentheses automatically.

This behavior is controlled by the Language Server, which is a component of the Godot Engine itself. This extension does not control the completions, so there's nothing I can do about it.

@DaelonSuzuka DaelonSuzuka closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@geekley
Copy link

geekley commented Oct 22, 2024

@DaelonSuzuka is there an upstream issue which I can track then? So they add an option in the LSP?

@DaelonSuzuka
Copy link
Collaborator

I don't interact with the engine development, so I have no idea.

@geekley
Copy link

geekley commented Oct 22, 2024

Found this, which I hope is the right issue, moved my comment there: godotengine/godot#86488 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed language server Issue is not originating from this extension, but from the LSP instead
Projects
None yet
Development

No branches or pull requests

6 participants