mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
languages/python: add basedpyright & python-lsp-server (#372)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* languages/python: add basedpyright LSP * languages/python: make basedpyright the default language server * languages/python: add python-lsp-server * docs: update 0.7 release notes
This commit is contained in:
parent
eb037b7bff
commit
cb7ff874e2
2 changed files with 40 additions and 3 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
cfg = config.vim.languages.python;
|
||||
|
||||
defaultServer = "pyright";
|
||||
defaultServer = "basedpyright";
|
||||
servers = {
|
||||
pyright = {
|
||||
package = pkgs.pyright;
|
||||
|
@ -30,6 +30,36 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
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"}''
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
python-lsp-server = {
|
||||
package = pkgs.python-lsp-server;
|
||||
lspConfig = ''
|
||||
lspconfig.pylsp.setup{
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/pylsp"}''
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "black";
|
||||
|
@ -61,11 +91,12 @@
|
|||
black-and-isort = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "black";
|
||||
runtimeInputs = [pkgs.black pkgs.isort];
|
||||
text = ''
|
||||
black --quiet - "$@" | isort --profile black -
|
||||
'';
|
||||
runtimeInputs = [pkgs.black pkgs.isort];
|
||||
};
|
||||
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue