mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Use pylsp instead of pyls
It seems that pyls, the original python language server has lost its momentum, and pylsp is a community driven fork of pyls. So nvim-lspconfig has dropped support for pyls in https://github.com/neovim/nvim-lspconfig/pull/1074. See also https://github.com/palantir/python-language-server/issues/935 and https://github.com/python-lsp/python-lsp-server/issues/27.
This commit is contained in:
parent
4689c4b22f
commit
ffb0601aca
@ -68,7 +68,7 @@ fi
|
|||||||
|
|
||||||
# Install some Python packages used by Neovim plugins.
|
# Install some Python packages used by Neovim plugins.
|
||||||
echo "Installing Python packages"
|
echo "Installing Python packages"
|
||||||
declare -a py_packages=("pynvim" 'python-language-server[all]' "black" "vim-vint" "pyls-isort" "pyls-mypy")
|
declare -a py_packages=("pynvim" 'python-lsp-server[all]' "black" "vim-vint" "pyls-isort" "pylsp-mypy")
|
||||||
|
|
||||||
if [[ "$SYSTEM_PYTHON" = true ]]; then
|
if [[ "$SYSTEM_PYTHON" = true ]]; then
|
||||||
echo "Using system Python to install $(PY_PACKAGES)"
|
echo "Using system Python to install $(PY_PACKAGES)"
|
||||||
|
|||||||
@ -20,13 +20,13 @@ plugins that utilize its Python binding. Pynvim is required by plugins such as
|
|||||||
pip install -U pynvim
|
pip install -U pynvim
|
||||||
```
|
```
|
||||||
|
|
||||||
## pyls
|
## python-lsp-server
|
||||||
|
|
||||||
[Pyls](https://github.com/palantir/python-language-server) is a Python Language
|
[python-lsp-server](https://github.com/python-lsp/python-lsp-server) is the community-fork of pyls, and it is a Python Language Server for completion,
|
||||||
Server for completion, linting, go to definition, etc.
|
linting, go to definition, etc.
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install "python-language-server[all]" pyls-isort pyls-mypy
|
pip install 'python-lsp-server[all]' pylsp-mypy pyls-isort
|
||||||
```
|
```
|
||||||
|
|
||||||
## Git
|
## Git
|
||||||
|
|||||||
@ -57,26 +57,29 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
lspconfig.pyls.setup{
|
lspconfig.pylsp.setup{
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
pyls = {
|
pylsp = {
|
||||||
plugins = {
|
plugins = {
|
||||||
flake8 = {enabled = false},
|
|
||||||
pylint = {enabled = true, executable = "pylint"},
|
pylint = {enabled = true, executable = "pylint"},
|
||||||
pyflakes = {enabled = false},
|
pyflakes = {enabled = false},
|
||||||
pycodestyle = {enabled = false},
|
pycodestyle = {enabled = false},
|
||||||
jedi_completion = {fuzzy = true},
|
jedi_completion = {fuzzy = true},
|
||||||
pyls_isort = {enabled = true},
|
pyls_isort = {enabled = true},
|
||||||
pyls_mypy = {enabled = true}
|
pylsp_mypy = {enabled = true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 500,
|
debounce_text_changes = 200,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- lspconfig.pyright.setup{
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- }
|
||||||
|
|
||||||
lspconfig.clangd.setup{
|
lspconfig.clangd.setup{
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user