[nvim] move from pylps to pyright
This commit is contained in:
parent
58bdfd856c
commit
0d2f897a71
1 changed files with 41 additions and 18 deletions
|
@ -82,6 +82,44 @@ return {
|
|||
lsp_attach = lsp_attach,
|
||||
})
|
||||
|
||||
configs = {
|
||||
pylsp = {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
mypy = { enabled = true },
|
||||
black = { enabled = true },
|
||||
isort = { enabled = true, profile = "black" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ruff_lsp = {
|
||||
settings = {
|
||||
args = {},
|
||||
format = {
|
||||
args = { "--line-length=120", "--config", "format.quote-style = 'single'" },
|
||||
},
|
||||
lint = {
|
||||
-- args = { "--config", "lint.select = ['F', 'E']", "--config", "lint.ignore = ['E501']" }
|
||||
}
|
||||
}
|
||||
},
|
||||
pyright = {
|
||||
settings = {
|
||||
pyright = {
|
||||
disableOptimizeImports = true,
|
||||
},
|
||||
python = {
|
||||
analysis = {
|
||||
typeCheckingMode = "basic",
|
||||
autoImportCompletions = false,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
-- Replace the language servers listed here
|
||||
|
@ -89,29 +127,14 @@ return {
|
|||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"gopls",
|
||||
"pylsp",
|
||||
"pyright",
|
||||
"ruff_lsp",
|
||||
"ts_ls",
|
||||
"mypy"
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
lsp_config = {}
|
||||
|
||||
if server_name == "pylsp" then
|
||||
lsp_config = {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
mypy = { enabled = true },
|
||||
black = { enabled = true },
|
||||
isort = { enabled = true, profile = "black" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
require('lspconfig')[server_name].setup(lsp_config)
|
||||
require('lspconfig')[server_name].setup(configs[server_name] or {})
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue