-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathpython.lua
More file actions
31 lines (30 loc) · 757 Bytes
/
python.lua
File metadata and controls
31 lines (30 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local opts = {
root_dir = function(fname)
local util = require "lspconfig.util"
local root_files = {
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
"Pipfile",
"manage.py",
"pyrightconfig.json",
}
return util.root_pattern(unpack(root_files))(fname) or util.root_pattern ".git"(fname) or util.path.dirname(fname)
end,
settings = {
pyright = {
disableLanguageServices = false,
disableOrganizeImports = false,
},
python = {
analysis = {
autoSearchPaths = true,
diagnosticMode = "workspace",
useLibraryCodeForTypes = true,
},
},
},
single_file_support = true,
}
require("lvim.lsp.manager").setup("pyright", opts)