Skip to content

Commit

Permalink
Use pylsp instead of pyls
Browse files Browse the repository at this point in the history
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 neovim/nvim-lspconfig#1074.
See also palantir/python-language-server#935
and python-lsp/python-lsp-server#27.
  • Loading branch information
jdhao committed Jul 15, 2021
1 parent 4689c4b commit ffb0601
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/Nvim_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fi

# Install some Python packages used by Neovim plugins.
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
echo "Using system Python to install $(PY_PACKAGES)"
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ plugins that utilize its Python binding. Pynvim is required by plugins such as
pip install -U pynvim
```

## pyls
## python-lsp-server

[Pyls](https://github.com/palantir/python-language-server) is a Python Language
Server for completion, linting, go to definition, etc.
[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,
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
Expand Down
13 changes: 8 additions & 5 deletions lua/config/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,29 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true

local lspconfig = require("lspconfig")

lspconfig.pyls.setup{
lspconfig.pylsp.setup{
on_attach = on_attach,
settings = {
pyls = {
pylsp = {
plugins = {
flake8 = {enabled = false},
pylint = {enabled = true, executable = "pylint"},
pyflakes = {enabled = false},
pycodestyle = {enabled = false},
jedi_completion = {fuzzy = true},
pyls_isort = {enabled = true},
pyls_mypy = {enabled = true}
pylsp_mypy = {enabled = true}
}
}
},
flags = {
debounce_text_changes = 500,
debounce_text_changes = 200,
}
}

-- lspconfig.pyright.setup{
-- on_attach = on_attach,
-- }

lspconfig.clangd.setup{
on_attach = on_attach,
capabilities = capabilities,
Expand Down

0 comments on commit ffb0601

Please sign in to comment.