diff --git a/lua/modules/lsp/backend.lua b/lua/modules/lsp/backend.lua index 26d0757d..614a3f8f 100644 --- a/lua/modules/lsp/backend.lua +++ b/lua/modules/lsp/backend.lua @@ -24,12 +24,10 @@ lspconfig.gopls.setup({ cmd = { 'gopls', 'serve' }, on_attach = M._attach, capabilities = M.capabilities, - init_options = { - usePlaceholders = true, - completeUnimported = true, - }, settings = { gopls = { + usePlaceholders = true, + completeUnimported = true, analyses = { unusedparams = true, }, diff --git a/lua/modules/lsp/package.lua b/lua/modules/lsp/package.lua index de4ad9da..13b293e2 100644 --- a/lua/modules/lsp/package.lua +++ b/lua/modules/lsp/package.lua @@ -20,29 +20,6 @@ packadd({ vim.diagnostic.config({ signs = { text = { i, i, i, i } } }) require('modules.lsp.backend') require('modules.lsp.frontend') - - -- auto kill server when no buffer attach after a while - local debounce - vim.api.nvim_create_autocmd('LspDetach', { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if not client or #client.attached_buffers > 0 then - return - end - - if debounce and debounce:is_active() then - debounce:stop() - debounce:close() - debounce = nil - end - - debounce:start(5000, 0, function() - vim.schedule(function() - pcall(vim.lsp.stop_client, args.data.client_id, true) - end) - end) - end, - }) end, })