fix(nvim): nil_ls uses lspconfig instead of mason-lspconfig

lean
pegasust 2023-07-10 02:08:36 -07:00
parent 22a78899ed
commit 7c4b7d0db6
2 changed files with 28 additions and 25 deletions

View File

@ -933,6 +933,32 @@ local inlay_hint_tsjs = {
includeInlayVariableTypeHints = true, includeInlayVariableTypeHints = true,
}; };
local setup = {
["nil_ls"] = function()
require('lspconfig').nil_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
--- refer to https://github.com/oxalica/nil/blob/main/docs/configuration.md
--- for the list of configurations available for `nil_ls`
settings = {
["nil"] = {
formatting = {
command = { "nix", "run", "nixpkgs#alejandra" },
},
nix = {
flake = {
-- calls `nix flake archive` to put a flake and its output to store
autoArchive = true,
-- auto eval flake inputs for improved completion
autoEvalInputs = true,
},
},
},
},
}
end,
}
require('mason-lspconfig').setup_handlers({ require('mason-lspconfig').setup_handlers({
-- default handler -- default handler
function(server_name) function(server_name)
@ -1039,32 +1065,9 @@ require('mason-lspconfig').setup_handlers({
}, },
} }
end, end,
["nil_ls"] = function()
require('lspconfig').nil_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
--- refer to https://github.com/oxalica/nil/blob/main/docs/configuration.md
--- for the list of configurations available for `nil_ls`
settings = {
["nil"] = {
formatting = {
command = { "nix", "run", "nixpkgs#alejandra" },
},
nix = {
flake = {
-- calls `nix flake archive` to put a flake and its output to store
autoArchive = true,
-- auto eval flake inputs for improved completion
autoEvalInputs = true,
},
},
},
},
}
end,
}) })
require('lspconfig')["nil_ls"].setup {} setup["nil_ls"]()
require("rust-tools").setup { require("rust-tools").setup {
tools = { tools = {
-- rust-tools options -- rust-tools options

View File

@ -63,7 +63,7 @@ in {
base-modules base-modules
++ [ ++ [
home-profiles.nerd_font_module home-profiles.nerd_font_module
home-profiles.git-htran home-profiles.git-pegasust
home-profiles.dev-packages home-profiles.dev-packages
home-profiles.zk home-profiles.zk
home-modules.darwin-spotlight home-modules.darwin-spotlight