From 6e0b3948963e52bb7f437ba6552e314f1d5ee0ba Mon Sep 17 00:00:00 2001 From: kalmenn Date: Mon, 2 Dec 2024 18:49:40 +0100 Subject: [PATCH] feat(lsp): Begone mason.nvim --- lazy-lock.json | 5 ++-- lua/plugins/lsp.lua | 73 ++++++++++++--------------------------------- 2 files changed, 21 insertions(+), 57 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 8851650..657a268 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,12 +6,11 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "crates.nvim": { "branch": "main", "commit": "1c924d5a9ea3496c4e1a02d0d51388ba809f8468" }, - "fd": { "branch": "master", "commit": "7a908a474cbcb3f37a4e6407a30d81bf85106217" }, + "fd": { "branch": "master", "commit": "4d957d3a630c53fc610b4c835a1ff992f98fa49d" }, "feline.nvim": { "branch": "main", "commit": "9f1313f61a75ec5ebe805fedd46bdc130c420963" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "idris2-nvim": { "branch": "main", "commit": "8bff02984a33264437e70fd9fff4359679d910da" }, "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "neo-tree-diagnostics.nvim": { "branch": "main", "commit": "e00434c3cf8637bcaf70f65c2b9d82b0cc9bd7dc" }, @@ -20,7 +19,7 @@ "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" }, "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, - "nvim-lspconfig": { "branch": "master", "commit": "627905ef6aabd99b31f369c33cd802a73144479c" }, + "nvim-lspconfig": { "branch": "master", "commit": "1aa9f36b6d542dafc0b4a38c48969d036003b00a" }, "nvim-metals": { "branch": "main", "commit": "f861db9fda55939797ac1b05238c49b0dcdc3bdb" }, "nvim-treesitter": { "branch": "master", "commit": "69170c93149ddb71a22bd954514806395c430c02" }, "nvim-web-devicons": { "branch": "master", "commit": "203da76ecfbb4b192cf830665b03eb651b635c94" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index cc45842..2f752a1 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,16 +1,5 @@ return { { import = "plugins/languages" }, - { - "williamboman/mason.nvim", - opts = {}, - }, - { - "williamboman/mason-lspconfig.nvim", - dependencies = { - "williamboman/mason.nvim", - }, - config = function() end, - }, { "neovim/nvim-lspconfig", dependencies = { @@ -51,51 +40,27 @@ return { local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require("lspconfig") - require("mason-lspconfig").setup({ - handlers = { - -- default handler - function(server_name) - lspconfig[server_name].setup({ - capabilities = capabilities, - }) - end, - -- overrides - ["rust_analyzer"] = function() - require("lazy").load({ plugins = { "rust-tools.nvim" } }) - end, - ["lua_ls"] = function() - lspconfig.lua_ls.setup({ - capabilities = capabilities, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, + if vim.fn.executable("lua-language-server") ~= 0 then + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", }, - }) - end, - ["ltex"] = function() - lspconfig.ltex.setup { - capabilities = capabilities, - settings = { - ltex = { - language = "auto", - }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), }, - } - end, - }, - }) + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, + }) + end end, }, }