diff options
Diffstat (limited to 'lua/lspconfig/pyright.lua')
| -rw-r--r-- | lua/lspconfig/pyright.lua | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lua/lspconfig/pyright.lua b/lua/lspconfig/pyright.lua index 86bb4295..165d99bc 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" +local server_name = 'pyright' +local bin_name = 'pyright-langserver' +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,8 +25,8 @@ 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, @@ -35,7 +35,7 @@ configs[server_name] = { analysis = { autoSearchPaths = true, useLibraryCodeForTypes = true, - diagnosticMode = "workspace", + diagnosticMode = 'workspace', }, }, }, @@ -43,11 +43,11 @@ configs[server_name] = { commands = { PyrightOrganizeImports = { organize_imports, - description = "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 |
