[vim/vim] lsp omnicomplete (clangd) doesn't autocomplete after -> (Issue #18445)

12 views
Skip to first unread message

Maxim Kim

unread,
Sep 29, 2025, 8:09:27 PM (19 hours ago) Sep 29
to vim/vim, Subscribed
habamax created an issue (vim/vim#18445)

Steps to reproduce

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

  1. vim --clean -S aclspclangd.vim ~/prj/vim/src/buffer.c +80
  2. owin->

Expected behaviour

Completion menu should show fields of win struct.

with yegappan/lsp built-in completion:

image.png (view on web)

with autocomplete using yegappan/lsp omnifunc:

image.png (view on web)

ping @girishji

Version of Vim

9.1.1813

Environment

debian13, bash

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18445@github.com>

Maxim Kim

unread,
Sep 29, 2025, 8:53:28 PM (19 hours ago) Sep 29
to vim/vim, Subscribed
habamax left a comment (vim/vim#18445)

It shows completion after . though:

image.png (view on web)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18445/3349547928@github.com>

girish

unread,
6:09 AM (9 hours ago) 6:09 AM
to vim/vim, Subscribed
girishji left a comment (vim/vim#18445)

> 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.Message ID: <vim/vim/issues/18445/3351105694@github.com>

girish

unread,
7:44 AM (8 hours ago) 7:44 AM
to vim/vim, Subscribed
girishji left a comment (vim/vim#18445)

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.

Screenshot.2025-09-30.at.1.40.28.PM.png (view on web)

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.Message ID: <vim/vim/issues/18445/3351606179@github.com>

Maxim Kim

unread,
8:05 AM (8 hours ago) 8:05 AM
to vim/vim, Subscribed
habamax left a comment (vim/vim#18445)

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.Message ID: <vim/vim/issues/18445/3351698878@github.com>

Maxim Kim

unread,
8:05 AM (8 hours ago) 8:05 AM
to vim/vim, Subscribed

Closed #18445 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/18445/issue_event/20007977154@github.com>

girish

unread,
10:08 AM (5 hours ago) 10:08 AM
to vim/vim, Subscribed
girishji left a comment (vim/vim#18445)

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.

Screenshot.2025-09-30.at.4.02.06.PM.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18445/3352374015@github.com>

Yegappan Lakshmanan

unread,
10:18 AM (5 hours ago) 10:18 AM
to vim/vim, Subscribed
yegappan left a comment (vim/vim#18445)

Thanks, I can live without signature.

@yegappan, just curious, if there is another way without mapping > to trigger showSignature?

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.Message ID: <vim/vim/issues/18445/3352424592@github.com>

Yegappan Lakshmanan

unread,
10:19 AM (5 hours ago) 10:19 AM
to vim/vim, Subscribed
yegappan left a comment (vim/vim#18445)

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.

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.Message ID: <vim/vim/issues/18445/3352432653@github.com>

Reply all
Reply to author
Forward
0 new messages