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.
This commit is contained in:
Marty Oehme 2025-06-08 17:36:09 +02:00
parent 3d1f925f78
commit 7cc7195f9a
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 11 additions and 4 deletions

View file

@ -7,9 +7,12 @@
-- with their respective names used by lspconfig, nvim-treesitter, nvim-lint and conform. -- with their respective names used by lspconfig, nvim-treesitter, nvim-lint and conform.
-- --
local nushell = { lsp = { nushell = {} }, ts = { "nu" } } local nushell = function()
if vim.fn.executable("nufmt") == 1 then local nushell = { ts = { "nu" } } -- nushell lsp directly built into `nu` cmd
if vim.fn.executable("nufmt") == 1 then
nushell.format = { nu = { "nufmt" } } nushell.format = { nu = { "nufmt" } }
end
return nushell
end end
-- FIXME: This does not work for populating LSP config, -- FIXME: This does not work for populating LSP config,
@ -96,7 +99,7 @@ local languages = {
format = { markdown = { "prettier", "injected" } }, format = { markdown = { "prettier", "injected" } },
}, },
nim = { lsp = { nim_langserver = {} }, ts = { "nim", "nim_format_string" }, format = { nim = { "nimpretty" } } }, nim = { lsp = { nim_langserver = {} }, ts = { "nim", "nim_format_string" }, format = { nim = { "nimpretty" } } },
nu = nushell, nu = nushell(),
python = { python = {
lsp = { basedpyright = {}, ruff = {} }, lsp = { basedpyright = {}, ruff = {} },
ts = { "python" }, ts = { "python" },

View file

@ -83,6 +83,10 @@ local lsp = {
end end
end end
if vim.fn.executable("nu") == 1 then
register("nushell")
end
register("marksman", { register("marksman", {
filetypes = { "markdown", "quarto" }, filetypes = { "markdown", "quarto" },
on_attach = function(client, _) on_attach = function(client, _)