languages/python: add basedpyright LSP

This commit is contained in:
raf 2024-09-13 16:56:49 +03:00
parent b347757f8a
commit 96dc5e3220
Signed by: NotAShelf
GPG key ID: AF26552424E53993

View file

@ -30,6 +30,21 @@
} }
''; '';
}; };
basedpyright = {
package = pkgs.basedpyright;
lspConfig = ''
lspconfig.basedpyright.setup{
capabilities = capabilities;
on_attach = default_on_attach;
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}''
}
}
'';
};
}; };
defaultFormat = "black"; defaultFormat = "black";
@ -61,11 +76,12 @@
black-and-isort = { black-and-isort = {
package = pkgs.writeShellApplication { package = pkgs.writeShellApplication {
name = "black"; name = "black";
runtimeInputs = [pkgs.black pkgs.isort];
text = '' text = ''
black --quiet - "$@" | isort --profile black - black --quiet - "$@" | isort --profile black -
''; '';
runtimeInputs = [pkgs.black pkgs.isort];
}; };
nullConfig = '' nullConfig = ''
table.insert( table.insert(
ls_sources, ls_sources,