I disable snippet support of clangd with following configuration.

capabilities = {
    textDocument = {
        completion = {
            completionItem = {
                snippetSupport = false,
    }                                                                                                                                                                                           },

But it only partly works. I don't see 'if~' snippet in suggestion list. But I can still see many other snippets, such as 'else~', 'else if~', 'include~' and so on. If I select these items, they won't be expanded and only the snippet name will be input. For example, if I select 'else if~', only 'else if' is input. It looks like the snippet feature is disabled, but I can still see the items. Is it possible to completely disable it?

1 Answer 1


Found a way to resolve this issue. In nvim-cmp, add 'nvim_lsp' source as following configuration to filter out snippets.

    name = 'nvim_lsp',
    group_index = 1,
    entry_filter = function(entry, ctx)
        return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Snippet'

Still don't know how to remove the snippets directly in clangd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.