anakin-language-server
anakin-language-server copied to clipboard
Preference: Remove plaintext completions for functions, and simplify snippet completions for functions
From my experience using this LS for a while:
- Just remove the plaintext completions for functions/methods, we have snippets.
- The snippets for functions/methods are actually too verbose. There is no need to put
f(${1:a}, ${2:b})into the buffer whenf($0)is sufficient. It is sufficient because there's signature help.
By the way I really like the named-argument completions foo=, bar=, etc.
From my experience using this LS for a while:
- 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
- The snippets for functions/methods are actually too verbose. There is no need to put
f(${1:a}, {2:b})into the buffer whenf($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.
;)
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 ,.
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?