pkgsets/nvim: update lsp config to use opts

This commit is contained in:
Kevin Baensch 2025-03-21 23:55:52 +01:00
parent d8f29e12b5
commit 378da9479f
Signed by: derped
GPG key ID: C0F1D326C7626543
17 changed files with 355 additions and 339 deletions

View file

@ -5,40 +5,50 @@
...
}:
lib.optionalString (lib.elem "nvim::lsp::python" config.machine.pkgs) # lua
''
lspconfig.pyright.setup({
cmd = {"${pkgs.pyright}/bin/pyright-langserver", "--stdio"},
lib.optionalAttrs (lib.elem "nvim::lsp::python" config.machine.pkgs) {
pyright = {
cmd = [
"${pkgs.pyright}/bin/pyright-langserver"
"--stdio"
];
settings = {
pyright = {
disableOrganizeImports = true;
};
python = {
# analysis = {
# ignore = { '*' },
# },
};
};
};
ruff = {
cmd = [
"${pkgs.ruff}/bin/ruff"
"server"
"--preview"
];
init_options = {
settings = {
pyright = {
disableOrganizeImports = true,
},
python = {
-- analysis = {
-- ignore = { '*' },
-- },
},
},
})
lspconfig.ruff.setup({
cmd = {"${pkgs.ruff}/bin/ruff", "server", "--preview"},
init_options = {
settings = {
-- Modification to any of these settings has no effect.
enable = true,
ignoreStandardLibrary = true,
organizeImports = true,
fixAll = true,
lint = {
enable = true,
run = 'onType',
},
},
},
on_attach = function(client, bufnr)
if client.name == 'ruff' then
client.server_capabilities.hoverProvider = false;
end
end,
})
''
# Modification to any of these settings has no effect.
enable = true;
ignoreStandardLibrary = true;
organizeImports = true;
fixAll = true;
lineLength = 120;
lint = {
enable = true;
run = "onType";
};
};
};
on_attach =
_: # lua
''
function(client, bufnr)
if client.name == 'ruff' then
client.server_capabilities.hoverProvider = false;
end
end'';
};
}