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

* 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:
raf 2024-09-16 13:28:33 +03:00 committed by GitHub
parent eb037b7bff
commit cb7ff874e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 3 deletions

View file

@ -95,7 +95,6 @@ configuration formats.
plugin's options can now be found under `indentBlankline.setupOpts`, the plugin's options can now be found under `indentBlankline.setupOpts`, the
previous iteration of the module also included out of place/broken options, previous iteration of the module also included out of place/broken options,
which have been removed for the time being. These are: which have been removed for the time being. These are:
- `listChar` - this was already unused - `listChar` - this was already unused
- `fillChar` - this had nothing to do with the plugin, please configure it - `fillChar` - this had nothing to do with the plugin, please configure it
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
@ -157,6 +156,7 @@ configuration formats.
- Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on - Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on
Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time
being. being.
- [](#opt-vim.ui.breadcrumbs.lualine.winbar.enable) has been added to allow - [](#opt-vim.ui.breadcrumbs.lualine.winbar.enable) has been added to allow
controlling the default behaviour of the `nvim-navic` component on Lualine, controlling the default behaviour of the `nvim-navic` component on Lualine,
which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled. which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled.
@ -164,6 +164,12 @@ configuration formats.
[](#opt-vim.ui.breadcrumbs.lualine.winbar.alwaysRender) to be conform to the [](#opt-vim.ui.breadcrumbs.lualine.winbar.alwaysRender) to be conform to the
new format. new format.
- Add [basedpyright](https://github.com/detachhead/basedpyright) as a Python LSP
server and make it default.
- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an
additional Python LSP server.
[ppenguin](https://github.com/ppenguin): [ppenguin](https://github.com/ppenguin):
- Telescope: - Telescope:

View file

@ -14,7 +14,7 @@
cfg = config.vim.languages.python; cfg = config.vim.languages.python;
defaultServer = "pyright"; defaultServer = "basedpyright";
servers = { servers = {
pyright = { pyright = {
package = pkgs.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"; defaultFormat = "black";
@ -61,11 +91,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,