From b35b7bca9d871556f85e0ffea5142d8984873eb0 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Wed, 29 Jan 2025 11:29:21 +0100 Subject: [PATCH] fix(nvim): warning with already attached buffer --- config/nvim/lua/plugins/lspconfig.lua | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/config/nvim/lua/plugins/lspconfig.lua b/config/nvim/lua/plugins/lspconfig.lua index b82c4af..b6b17d6 100644 --- a/config/nvim/lua/plugins/lspconfig.lua +++ b/config/nvim/lua/plugins/lspconfig.lua @@ -4,7 +4,7 @@ return { "neovim/nvim-lspconfig", init = function() require("lazyvim.util").lsp.on_attach(function(_, buffer) - -- stylua: ignore + -- stylua: ignore vim.keymap.set("n", "g0", "Telescope lsp_document_symbols", { buffer = buffer, desc = "Document Symbols" }) vim.keymap.set("n", "cc", "lua vim.lsp.buf.code_action()", { buffer = buffer, desc = "Code Action" }) end) @@ -15,7 +15,6 @@ return { astro = {}, cssls = {}, cssmodules_ls = {}, - denols = {}, diagnosticls = {}, emmet_ls = {}, graphql = {}, @@ -23,22 +22,14 @@ return { jsonls = {}, lua_ls = {}, svelte = {}, - tsserver = {}, + denols = { + root_dir = require("lspconfig").util.root_pattern("deno.json", "deno.jsonc"), + }, + tsserver = { + root_dir = require("lspconfig").util.root_pattern("package.json"), + single_file_support = false, + }, yamlls = {}, }, }, - setup = function() - local nvim_lsp = require("lspconfig") - - nvim_lsp.denols.setup({ - on_attach = on_attach, - root_dir = nvim_lsp.util.root_pattern("deno.json", "deno.jsonc"), - }) - - nvim_lsp.tsserver.setup({ - on_attach = on_attach, - root_dir = nvim_lsp.util.root_pattern("package.json"), - single_file_support = false, - }) - end, }