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

Only complete arguments for snippets #1263

Merged

Conversation

the-mikedavis
Copy link
Contributor

@the-mikedavis the-mikedavis commented Apr 9, 2022

This prevents the completion provider from providing arguments for functions/macros when an editor does not enable snippets. With snippet support, arguments are useful because they can be tabbed between, but for an editor which does not implement snippets, the generated arguments are mostly a hassle: you have to move backwards to replace the arguments. This style of completion is in line with other language server implementations I've used: rust-analyzer, clangd, and elixir_ls, although the Swift sourcekit-lsp does something similar to the current behavior.

IMO this is a better default behavior and it plays well with signature help (helix-editor/helix#1755), but given that it has been the default behavior for so long, maybe this should be configurable and disabled by default?

Fixes #772.
An asciicast of the change: https://asciinema.org/a/485630. The first edit uses this branch and the second uses erlang_ls 0.23.1.

What do you think?

This commit prevents the completion provider from providing arguments
for functions/macros when an editor does not enable snippets. With
snippet support, arguments are useful because they can be tabbed between,
but for an editor which does not implement snippets, the generated
arguments are mostly a hassle: you have to move back to replace the
arguments.
@robertoaloi
Copy link
Member

This makes total sense to me, thanks! Will wait for CI and then merge.

@robertoaloi robertoaloi merged commit 2d29744 into erlang-ls:main Apr 28, 2022
@the-mikedavis the-mikedavis deleted the md-disable-arg-autocomplete branch April 28, 2022 13:34
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

Successfully merging this pull request may close these issues.

Consider the auto-completion model used in elixir_ls
2 participants