diff --git a/.config/nvim/lua/lsp/c.lua b/.config/nvim/lua/lsp/c.lua index e9277c0..986eca3 100644 --- a/.config/nvim/lua/lsp/c.lua +++ b/.config/nvim/lua/lsp/c.lua @@ -3,11 +3,18 @@ -- License : GPLv3 -- Description : clangd config file for lsp +-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) + + require("lspconfig").clangd.setup { cmd = { "clangd", "--background-index", "--suggest-missing-includes", "--clang-tidy", "--header-insertion=iwyu" - } + }, + -- The following example advertise capabilities to `clangd`. + capabilities = capabilities, } diff --git a/.config/nvim/lua/lsp/lua.lua b/.config/nvim/lua/lsp/lua.lua index 11567ec..892afc2 100644 --- a/.config/nvim/lua/lsp/lua.lua +++ b/.config/nvim/lua/lsp/lua.lua @@ -21,7 +21,7 @@ require'lspconfig'.sumneko_lua.setup { }, diagnostics = { -- Get the language server to recognize the `vim` global - globals = {'vim'}, + globals = {"vim", "use", "globals", "utils"}, }, workspace = { -- Make the server aware of Neovim runtime files