aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-01-12 14:40:57 +0100
committerGitHub <noreply@github.com>2022-01-12 14:40:57 +0100
commit34a320ca296fc673945f39ad4dd1e13c3749f7c8 (patch)
tree4f2f4157a65b84086c1eecf0d767e265d33343c4 /lua
parentadd pylsp schema (diff)
downloadmason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.tar
mason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.tar.gz
mason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.tar.bz2
mason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.tar.lz
mason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.tar.xz
mason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.tar.zst
mason-34a320ca296fc673945f39ad4dd1e13c3749f7c8.zip
pylsp: add autocompletion to PylspInstall command (#418)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/servers/pylsp/README.md8
-rw-r--r--lua/nvim-lsp-installer/servers/pylsp/init.lua13
2 files changed, 21 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/servers/pylsp/README.md b/lua/nvim-lsp-installer/servers/pylsp/README.md
index ce756de3..426cf7fd 100644
--- a/lua/nvim-lsp-installer/servers/pylsp/README.md
+++ b/lua/nvim-lsp-installer/servers/pylsp/README.md
@@ -1,9 +1,17 @@
# Pylsp
## Installing pylsp plugins
+
Pylsp has [third party plugins](https://github.com/python-lsp/python-lsp-server#3rd-party-plugins) which are not installed by default.
In order for these plugins to work with the `pylsp` server managed by this plugin, they need to be installed in the same [virtual environment](https://docs.python.org/3/library/venv.html) as `pylsp`. For these reasons, there's a convenient `:PylspInstall <packages>` command that does this for you, for example:
+
```vim
:PylspInstall pyls-flake8 pylsp-mypy pyls-isort
```
+
+The `:PylspInstall` command will only be available once the `pylsp` server is started (this happens once you've opened a
+Python file, for example).
+
+**Note that these extra pylsp plugins will not be reinstalled if you update/reinstall the `pylsp` server, you will have to manage
+them manually.**
diff --git a/lua/nvim-lsp-installer/servers/pylsp/init.lua b/lua/nvim-lsp-installer/servers/pylsp/init.lua
index 87db157d..a676109b 100644
--- a/lua/nvim-lsp-installer/servers/pylsp/init.lua
+++ b/lua/nvim-lsp-installer/servers/pylsp/init.lua
@@ -3,6 +3,18 @@ local pip3 = require "nvim-lsp-installer.installers.pip3"
local process = require "nvim-lsp-installer.process"
local notify = require "nvim-lsp-installer.notify"
+function _G.lsp_installer_pylsp_install_completion()
+ return table.concat({
+ "pyls-flake8",
+ "pylsp-mypy",
+ "pyls-spyder",
+ "pyls-isort",
+ "python-lsp-black",
+ "pyls-memestra",
+ "pylsp-rope",
+ }, "\n")
+end
+
return function(name, root_dir)
return server.Server:new {
name = name,
@@ -37,6 +49,7 @@ return function(name, root_dir)
end,
description = "Installs the provided packages in the same venv as pylsp.",
["nargs=+"] = true,
+ ["complete=custom,v:lua.lsp_installer_pylsp_install_completion"] = true,
},
},
},