diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-07-03 14:45:08 -0700 |
|---|---|---|
| committer | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-07-03 15:49:27 -0700 |
| commit | ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c (patch) | |
| tree | 77d533dc9606ca7e9b30d1a96baebf3de325d2a8 /lua/lspconfig/pyright.lua | |
| parent | [docgen] Update CONFIG.md (diff) | |
| download | nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.gz nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.bz2 nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.lz nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.xz nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.zst nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.zip | |
ci: lint and format with stylua
Diffstat (limited to 'lua/lspconfig/pyright.lua')
| -rw-r--r-- | lua/lspconfig/pyright.lua | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/lua/lspconfig/pyright.lua b/lua/lspconfig/pyright.lua index bb22a27f..86bb4295 100644 --- a/lua/lspconfig/pyright.lua +++ b/lua/lspconfig/pyright.lua @@ -1,23 +1,23 @@ -local configs = require 'lspconfig/configs' -local util = require 'lspconfig/util' +local configs = require "lspconfig/configs" +local util = require "lspconfig/util" local server_name = "pyright" local bin_name = "pyright-langserver" -if vim.fn.has('win32') == 1 then - bin_name = bin_name..".cmd" +if vim.fn.has "win32" == 1 then + bin_name = bin_name .. ".cmd" end local root_files = { - 'setup.py', - 'pyproject.toml', - 'setup.cfg', - 'requirements.txt', - '.git', + "setup.py", + "pyproject.toml", + "setup.cfg", + "requirements.txt", + ".git", } local function organize_imports() local params = { - command = 'pyright.organizeimports', + command = "pyright.organizeimports", arguments = { vim.uri_from_bufnr(0) }, } vim.lsp.buf.execute_command(params) @@ -25,36 +25,35 @@ end configs[server_name] = { default_config = { - cmd = {bin_name, "--stdio"}; - filetypes = {"python"}; + cmd = { bin_name, "--stdio" }, + filetypes = { "python" }, root_dir = function(filename) - return util.root_pattern(unpack(root_files))(filename) or - util.path.dirname(filename) - end; + return util.root_pattern(unpack(root_files))(filename) or util.path.dirname(filename) + end, settings = { python = { analysis = { - autoSearchPaths = true; - useLibraryCodeForTypes = true; - diagnosticMode = 'workspace'; - }; - }; - }; - }; + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = "workspace", + }, + }, + }, + }, commands = { PyrightOrganizeImports = { - organize_imports; - description = "Organize Imports"; - }; - }; + organize_imports, + description = "Organize Imports", + }, + }, docs = { - package_json = 'https://raw.githubusercontent.com/microsoft/pyright/master/packages/vscode-pyright/package.json', + package_json = "https://raw.githubusercontent.com/microsoft/pyright/master/packages/vscode-pyright/package.json", description = [[ https://github.com/microsoft/pyright `pyright`, a static type checker and language server for python -]]; - }; +]], + }, } -- vim:et ts=2 sw=2 |
