feat: update lsp config

c: make nvim-cmp capabalities available
lua: ignore some non-standard keywords
This commit is contained in:
David JULIEN 2021-10-12 14:01:37 +02:00
parent 05d89420f0
commit 101d37ff52
2 changed files with 9 additions and 2 deletions

View File

@ -3,11 +3,18 @@
-- License : GPLv3 -- License : GPLv3
-- Description : clangd config file for lsp -- 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 { require("lspconfig").clangd.setup {
cmd = { "clangd", cmd = { "clangd",
"--background-index", "--background-index",
"--suggest-missing-includes", "--suggest-missing-includes",
"--clang-tidy", "--clang-tidy",
"--header-insertion=iwyu" "--header-insertion=iwyu"
} },
-- The following example advertise capabilities to `clangd`.
capabilities = capabilities,
} }

View File

@ -21,7 +21,7 @@ require'lspconfig'.sumneko_lua.setup {
}, },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = {'vim'}, globals = {"vim", "use", "globals", "utils"},
}, },
workspace = { workspace = {
-- Make the server aware of Neovim runtime files -- Make the server aware of Neovim runtime files