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

Preference: Remove plaintext completions for functions, and simplify snippet completions for functions #10

Open
rwols opened this issue May 15, 2020 · 3 comments

Comments

@rwols
Copy link

rwols commented May 15, 2020

From my experience using this LS for a while:

  1. Just remove the plaintext completions for functions/methods, we have snippets.
  2. The snippets for functions/methods are actually too verbose. There is no need to put f(${1:a}, ${2:b}) into the buffer when f($0) is sufficient. It is sufficient because there's signature help.

By the way I really like the named-argument completions foo=, bar=, etc.

@muffinmad
Copy link
Owner

From my experience using this LS for a while:

  1. Just remove the plaintext completions for functions/methods, we have snippets.

Maybe completion must be moved before plaintext one, but I rather keep them. There are some cases when snippets are not needed:

  • import
from datetime import datetime
  • assign function to variable
if foo:
    func = some_function
else:
    func = some_other_function
  1. The snippets for functions/methods are actually too verbose. There is no need to put f(${1:a}, {2:b}) into the buffer when f($0) is sufficient. It is sufficient because there's signature help.

Only required positional arguments are placed in snippet. This way you can skip type , after each argument and move between them with TAB key.

By the way I really like the named-argument completions foo=, bar=, etc.

;)

@rwols
Copy link
Author

rwols commented May 19, 2020

Maybe completion must be moved before plaintext one, but I rather keep them. There are some cases when snippets are not needed:

OK, can we get the snippet variants above the non-snippet variants for functions then?

Only required positional arguments are placed in snippet. This way you can skip type , after each argument and move between them with TAB key.

I understand that. It's just that it's actually more intuitive to use the signatureHelp for this. It refreshes once the user types a ,.

@muffinmad
Copy link
Owner

OK, can we get the snippet variants above the non-snippet variants for functions then?

Check out completion_snippet_first configuration option in the recent master.

I understand that. It's just that it's actually more intuitive to use the signatureHelp for this. It refreshes once the user types a ,.

Well, eglot (LSP client for Emacs) refreshes signature help also on moving to the next snippet field by TAB key.

Do you think using tab as retriggerCharacters in the SignatureHelpOptions will help?

I think what you propose is not the snippet anymore. It's kind of place-pares-after-func option, isn't it?

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

2 participants