From 5cd9366a063403893481f68be0ed0b1af9a59468 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Wed, 5 May 2021 19:52:51 +0200 Subject: add pylsp Signed-off-by: Michael Weimann --- lua/lspconfig/pylsp.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lua/lspconfig/pylsp.lua (limited to 'lua') diff --git a/lua/lspconfig/pylsp.lua b/lua/lspconfig/pylsp.lua new file mode 100644 index 00000000..d98ff432 --- /dev/null +++ b/lua/lspconfig/pylsp.lua @@ -0,0 +1,37 @@ +local configs = require 'lspconfig/configs' +local util = require 'lspconfig/util' + +configs.pylsp = { + default_config = { + cmd = {"pylsp"}; + filetypes = {"python"}; + root_dir = function(fname) + local root_files = { + "pyproject.toml", + "setup.py", + "setup.cfg", + "requirements.txt", + "Pipfile" + } + return util.root_pattern(unpack(root_files))(fname) or + util.find_git_ancestor(fname) or + util.path.dirname(fname) + end; + }; + docs = { + description = [[ +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +The language server has to be installed separately for example by `pipx install python-lsp-server`. +Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). + +Note: This is a community for of `pyls`. + ]]; + default_config = { + root_dir = "vim's starting directory"; + }; + }; +}; +-- vim:et ts=2 sw=2 -- cgit v1.2.3-70-g09d2