How can I disable the snippets from clangd

I’d like to use my own snippets, so the clangd’s snippets is redundant for me.

I have tried to disable it in lspconfig:

require("lspconfig").clangd.setup({
	capabilities = {
		textDocument = {
			completion = {
				completionItem = {
					snippetSupport = false,
				},
			},
		},
	},
})

But it doesn’t work.

Anyone can help me to disable the snippets from lsp? Much appreciated!!

Did you figure out how to do this?

lspconfig.clangd.setup {
    on_attach = M.on_attach,
    capabilities = {
        textDocument = {
            completion = {
                completionItem = {
                    commitCharactersSupport = true,
                    deprecatedSupport = true,
                    insertReplaceSupport = true,
                    labelDetailsSupport = true,
                    preselectSupport = true,
                    resolveSupport = {
                        properties = { "documentation", "detail", "additionalTextEdits" }
                    },
                    snippetSupport = false,
                    tagSupport = {
                        valueSet = { 1 }
                    }
                }
            }
        }
    },
    -- single_file_support = true,
    -- root_dir = root_dir('c'),
    filetyped = { "c", "cpp" },
    cmd = {
        "clangd",
        "--enable-config",
        -- "--clang-tidy",
        -- "--all-scopes-completion=false",
        "--background-index",
        "--header-insertion=iwyu",
        "--pch-storage=memory"
    }
}
1 Like

Where I can find more details about the capabilities table general syntax? lsp-config docs does not describe its fields.