anakin-language-server icon indicating copy to clipboard operation
anakin-language-server copied to clipboard

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

Open rwols opened this issue 5 years ago • 3 comments

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.

rwols avatar May 15 '20 18:05 rwols

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.

;)

muffinmad avatar May 15 '20 19:05 muffinmad

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 ,.

rwols avatar May 19 '20 16:05 rwols

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?

muffinmad avatar May 19 '20 20:05 muffinmad