diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/pylyzer.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/pylyzer.lua b/lua/lspconfig/server_configurations/pylyzer.lua new file mode 100644 index 00000000..5b90d494 --- /dev/null +++ b/lua/lspconfig/server_configurations/pylyzer.lua @@ -0,0 +1,40 @@ +local util = require('lspconfig').util + +local bin_name = 'pylyzer' +local cmd = { bin_name, '--server' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--server' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'setup.py', + 'tox.ini', + 'requirements.txt', + 'Pipfile', + 'pyproject.toml', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + settings = { + python = { + diagnostics = true, + inlayHints = true, + smartCompletion = true, + checkOnType = false, + }, + }, + }, + docs = { + description = [[ + https://github.com/mtshiba/pylyzer + + `pylyzer`, a fast static code analyzer & language server for Python. + ]], + }, +} |
