The way that "signature window", really "preview window", works is this:
- The
:help 'omnifunc'
, if there is one, returns a list of dictionaries, one for each completion suggestion.
- Those dictionaries can have a non-mandatory
info
field that contains the text to display in the preview window if preview
is in :help 'completeopts'
.
- The preview window is triggered automatically when
completeopts
contains preview
AND when the info field is populated.
In this case, that info
field is populated on the fly by ccomplete#Complete()
, with info gathered from tags, files, etc.. It is the value of that field that is displayed in the preview window and there is currently no built-in way to get that exact text in a preview window or elsewhere without using omni-completion.
Now, all the code used to generate that info
field is under $VIMRUNTIME/autoload/ccomplete.vim
(and it even has been rewritten in vim9script) so it should be doable to cobble something up out of it.
ccomplete#Complete
. I am still not able to find the code that opens that preview window.ccomplete#Complete
doesn't seem to readcompleteopt
or open preview window by itself. May be some autocommand is doing this.