From 46d18355c7e3c8ad841e10ee176e90dc0ebdb878 Mon Sep 17 00:00:00 2001 From: Markus Dieckmann Date: Tue, 14 Mar 2023 16:52:04 +0100 Subject: [PATCH] deactivate sumneko_lua --- nvim/lua/new_lsp_conf.lua | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/nvim/lua/new_lsp_conf.lua b/nvim/lua/new_lsp_conf.lua index c96ecdb..ff13796 100644 --- a/nvim/lua/new_lsp_conf.lua +++ b/nvim/lua/new_lsp_conf.lua @@ -30,11 +30,15 @@ local on_attach = function(client, bufnr) vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'f', vim.lsp.buf.format, bufopts) + + if vim.bo[bufnr].buftype ~= "" or vim.bo[bufnr].filetype == "helm" then + vim.diagnostic.disable() + end end local lsp_flags = { -- This is the default in Nvim 0.7+ - debounce_text_changes = 150, + debounce_text_changes = 250, } local capabilities = require('cmp_nvim_lsp').default_capabilities( vim.lsp.protocol.make_client_capabilities() @@ -47,7 +51,7 @@ require('mason-lspconfig').setup_handlers { capabilities = capabilities } end, - ['rust_analyzer'] = function() + ['rust_analyzer'] = function() local rustToolsOpts = { tools = { inlay_hints = { @@ -62,7 +66,7 @@ require('mason-lspconfig').setup_handlers { capabilities = capabilities, flags = lsp_flags, settings = { - ["rust_analyzer"] = { + ["rust_analyzer"] = { checkOnSave = { command = "clippy" } @@ -78,23 +82,34 @@ require('mason-lspconfig').setup_handlers { flags = lsp_flags, -- server-specific settings... settings = { - ["rust-analyzer"] = {} + ["rust-analyzer"] = {} } } end, - ['sumneko_lua'] = function() - require('lspconfig')["sumneko_lua"].setup { + ['yamlls'] = function() + require('lspconfig')["yamlls"].setup { on_attach = on_attach, flags = lsp_flags, settings = { - Lua = { - diagnostics = { - globals = { "vim" } - } + yaml = { + schemas = { kubernetes = "globPattern" }, } } } - end, + end + -- ['sumneko_lua'] = function() + -- require('lspconfig')["sumneko_lua"].setup { + -- on_attach = on_attach, + -- flags = lsp_flags, + -- settings = { + -- Lua = { + -- diagnostics = { + -- globals = { "vim" } + -- } + -- } + -- } + -- } + -- end, } --require('lspconfig')['rust_analyzer'].setup { -- on_attach = on_attach, @@ -104,4 +119,4 @@ require('mason-lspconfig').setup_handlers { -- ["rust-analyzer"] = {} -- } --} -require"fidget".setup{} +require "fidget".setup {}