From 1434df5a68533810b1db5af2cf396aa8cb11187f Mon Sep 17 00:00:00 2001 From: Nydragon Date: Sun, 1 Sep 2024 19:46:19 +0200 Subject: [PATCH] feat: simplify lua lsp --- lua/nvim-lsp-config.lua | 48 ++++++++++++----------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/lua/nvim-lsp-config.lua b/lua/nvim-lsp-config.lua index cd46d7e..8bbe500 100644 --- a/lua/nvim-lsp-config.lua +++ b/lua/nvim-lsp-config.lua @@ -52,46 +52,26 @@ lspconfig.pyright.setup({ lspconfig.clangd.setup({}) -lspconfig.rust_analyzer.setup({}) +lspconfig.rust_analyzer.setup({ + settings = { + ["rust-analyzer"] = { + diagnostics = { + enable = false, + }, + check = { allTargets = false, extraArgs = { "--target", "xtensa-esp32s3-none-elf" } }, + }, + }, +}) ---lspconfig.nixd.setup({}) +lspconfig.nil_ls.setup({}) lspconfig.r_language_server.setup({}) --lspconfig.qmlls.setup({}) - -lspconfig.nil_ls.setup({}) - -lspconfig.lua_ls.setup({ - on_init = function(client) - local path = client.workspace_folders[1].name - if vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc") then - return - end - - client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { - runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - -- Make the server aware of Neovim runtime files - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - -- Depending on the usage, you might want to add additional paths here. - -- "${3rd}/luv/library" - -- "${3rd}/busted/library", - }, - }, - }) - end, - settings = { - Lua = {}, - }, -}) +lspconfig.lua_ls.setup({}) lspconfig.bashls.setup({}) lspconfig.zls.setup({}) + +lspconfig.tsserver.setup({})