From 7cc7195f9ac9dfa970dda8003ad50e722bdeb76b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 8 Jun 2025 17:36:09 +0200 Subject: [PATCH] nvim: Update nushell lsp installation Nushell lsp is now integrated directly into the 'nu' command. This update stops mason from trying to install a 'nushell' LSP and simply activates the nu-internal LSP if it finds the correct executable instead. --- nvim/.config/nvim/lua/core/languages.lua | 11 +++++++---- nvim/.config/nvim/lua/plugins/lsp.lua | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index 2bd28f3..eb142fa 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -7,9 +7,12 @@ -- with their respective names used by lspconfig, nvim-treesitter, nvim-lint and conform. -- -local nushell = { lsp = { nushell = {} }, ts = { "nu" } } -if vim.fn.executable("nufmt") == 1 then - nushell.format = { nu = { "nufmt" } } +local nushell = function() + local nushell = { ts = { "nu" } } -- nushell lsp directly built into `nu` cmd + if vim.fn.executable("nufmt") == 1 then + nushell.format = { nu = { "nufmt" } } + end + return nushell end -- FIXME: This does not work for populating LSP config, @@ -96,7 +99,7 @@ local languages = { format = { markdown = { "prettier", "injected" } }, }, nim = { lsp = { nim_langserver = {} }, ts = { "nim", "nim_format_string" }, format = { nim = { "nimpretty" } } }, - nu = nushell, + nu = nushell(), python = { lsp = { basedpyright = {}, ruff = {} }, ts = { "python" }, diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index f2e7009..e85672b 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -83,6 +83,10 @@ local lsp = { end end + if vim.fn.executable("nu") == 1 then + register("nushell") + end + register("marksman", { filetypes = { "markdown", "quarto" }, on_attach = function(client, _)