Problem: A function used through 'omnifunc' or 'complete' is called the
same way whether 'autocomplete' started the completion or a key
asked for one, so it cannot answer differently.
Solution: Report which of the two it is in complete_info() as "auto".
It is returned only when asked for in {what}, so what
complete_info() says by itself does not change.
related: h-east/lsp.vim#2
With 'autocomplete', Vim asks the sources in 'complete' after every printable
character and when Insert mode is entered. A language server asks for less
than that: automatically where an identifier is being typed and after the
characters it lists in completionProvider.triggerCharacters, "." for
instance, and nowhere else. What the user asks for by hand is a case of its
own, and may be answered wherever the cursor stands.
The function is called the same way in all of them, so a client has to pick
one behavior: ask the server on every key, which puts a menu up after a
bracket or a space, or turn down the request the user typed CTRL-X CTRL-O for.
The way around that today is a second function, which the user has to put in
'complete' by hand while 'complete' documents "o" as the way an LSP client's
'omnifunc' is used. With "auto" one function covers both cases. A source that
is slow to gather matches can use it as well, to take a cheaper path when
nobody asked.
complete_info() by itself is unchanged: "auto" comes back only when it is in
{what}.
https://github.com/vim/vim/pull/21143
(5 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()