From 4a2fcc93d10d02609cf4bda91a37f07161310c75 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 21 Aug 2022 18:06:45 +0200 Subject: [PATCH] nvim: lsp: remove double clangd definition --- .config/nvim/lua/my/lsp.lua | 44 ++++++++++++++----------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/.config/nvim/lua/my/lsp.lua b/.config/nvim/lua/my/lsp.lua index d7dab02..6093225 100644 --- a/.config/nvim/lua/my/lsp.lua +++ b/.config/nvim/lua/my/lsp.lua @@ -84,36 +84,26 @@ vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( -- setup servers local lspconfig = require('lspconfig') -if vim.fn.executable('clangd') > 0 then - lspconfig.clangd.setup { - cmd = { - 'clangd', - '--compile-commands-dir=build', - '--clang-tidy', -- needs >=clangd-9 - '--ranking-model=decision_forest' -- needs >=clangd-12 - }, - on_attach = on_attach, - capabilities = capabilities - } -end -require("clangd_extensions").setup({ - server = { - cmd = { - 'clangd', - '--compile-commands-dir=build', - '--clang-tidy', -- needs >=clangd-9 - '--ranking-model=decision_forest' -- needs >=clangd-12 +if vim.fn.executable('clangd') > 0 then + require("clangd_extensions").setup({ + server = { + cmd = { + 'clangd', + '--compile-commands-dir=build', + '--clang-tidy', -- needs >=clangd-9 + '--ranking-model=decision_forest' -- needs >=clangd-12 + }, + on_attach = on_attach, + capabilities = capabilities }, - on_attach = on_attach, - capabilities = capabilities - }, - extensions = { - inlay_hints = { - show_parameter_hints = false + extensions = { + inlay_hints = { + show_parameter_hints = false + } } - } -}) + }) +end if vim.fn.executable('lua-language-server') > 0 then lspconfig.sumneko_lua.setup({