aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorJonathan <git@jonathansm.dev>2023-04-08 19:36:17 -0500
committerGitHub <noreply@github.com>2023-04-09 08:36:17 +0800
commit886ef7bd76b08d86de3bca6ed9373d2e95c31c55 (patch)
treeaabdfa074a84195b2aa6b947923646e338632c24 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.tar
nvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.tar.gz
nvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.tar.bz2
nvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.tar.lz
nvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.tar.xz
nvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.tar.zst
nvim-lspconfig-886ef7bd76b08d86de3bca6ed9373d2e95c31c55.zip
feat: add pylyzer lsp config (#2548)
* feat(server_configurations): add pylyzer lsp config Added a configuration for the pylyzer LSP. Made sure not to edit any docs, only the Lua source code. * style(linting): make the linter happy for pylyzer Got an error that I can't use `util.path.dirname()` when finding the root directory so I took that out. * fix(pylyzer): windows support Now checks for windows support and runs cmd.exe if it's running on Windows. * fix(pylyzer): no more linting errors Fixed the linting errors even if I disagree with the style.
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/pylyzer.lua40
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.
+ ]],
+ },
+}