aclspclangd.vim
:
vim9script
set complete=o,.
set completeopt=menuone,popup,fuzzy
set autocomplete
set packpath=~/.config/vim
packadd lsp
g:LspOptionsSet({
autoComplete: false,
filterCompletionDuplicates: true,
})
if executable('clangd')
g:LspAddServer([{
name: 'clangd',
filetype: ['c', 'cpp'],
path: 'clangd',
args: ['--background-index'],
}])
endif
vim --clean -S aclspclangd.vim ~/prj/vim/src/buffer.c +80
owin->
Completion menu should show fields of win
struct.
with yegappan/lsp
built-in completion:
with autocomplete
using yegappan/lsp
omnifunc:
ping @girishji
9.1.1813
debian13, bash
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
It shows completion after .
though:
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
>
is treated different -- have to look into it. Quick workaround is :call test_override("char_avail", 1)
.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
This is caused by the LSP client: it maps >
to show a signature
(see https://github.com/yegappan/lsp/blob/50dc155e98352c7710e4a3175000a96a08447c77/autoload/lsp/signature.vim#L75).
When you type >
, Vim expands it into ><C-R>=g:LspShowSignature()<CR>
in the typeahead buffer,
which prevents insert-mode completion.
To avoid this, disable signature help with:
:call g:LspOptionsSet({ 'showSignature': v:false })
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Thanks, I can live without signature.
@yegappan, just curious, if there is another way without mapping >
to trigger showSignature
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #18445 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I’m not sure which triggerCharacters
an LSP server may provide, and none of them will reliably work with the completion mechanism. I recommend avoiding inoremap
and instead calling LspShowSignature()
directly after filtering for these characters in insert mode.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Thanks, I can live without signature.
@yegappan, just curious, if there is another way without mapping
>
to triggershowSignature
?
InsertCharPre
, like the recent commit to fix autoPair plugins?
The recent commit to address the conflict with autopair plugins should address this also.
After this commit, the trigger characters are no longer mapped (if Vim has patch 9.1.563).
Can you check whether the >
character is mapped after this commit?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I’m not sure which
triggerCharacters
an LSP server may provide, and none of them will reliably work with the completion mechanism. I recommend avoidinginoremap
and instead callingLspShowSignature()
directly after filtering for these characters in insert mode.
The commit yegappan/lsp@d1c6748 implements the above.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.