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

LSP: Add parentheses and cursor position when completing functions #3674

Closed
themartdev opened this issue Oct 6, 2024 · 5 comments
Closed

Comments

@themartdev
Copy link

Hi!
I'm not sure how opinionated this is, but I would like for function completion to add parentheses and position the cursor inside/outside of those depending on the arity of the function:

pub fn main() {
  io.debug(<cursor>)
  wisp.configure_logger()<cursor>
}

The only case where I can think it could be a downgrade is with pipes, but maybe we can have different behavior in that context

@themartdev
Copy link
Author

themartdev commented Oct 6, 2024

For reference, here's the behavior with gopls

Screencast.from.2024-10-06.14-34-14.webm

@lpil
Copy link
Member

lpil commented Oct 7, 2024

Please see prior discussion for why we do not implement this presently.

@lpil lpil closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
@themartdev
Copy link
Author

@lpil Can you point me to the discussion in question? I found the older issues regarding autocompletion, but I can't find anything related to this

@giacomocavalieri
Copy link
Member

Hello! The prior discussion happened here #3308 (comment)

@themartdev
Copy link
Author

themartdev commented Oct 7, 2024

Thanks. I understand the point of view. Personally I think that since the frequency of using a function as a value is often much lower than calling it directly, in the end it's more annoying to add brackets most of the time vs deleting it sometimes. But it does seem like a completely subjective view, and maybe since Gleam is a functional language the proportion is not as one-sided as a language like go.

Of course the best case would be to make it context-dependant, but I don't think it's something we can expect in the short term.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants