[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,23 +82,8 @@ return {
|
|||
lsp_attach = lsp_attach,
|
||||
})
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
-- Replace the language servers listed here
|
||||
-- with the ones you want to install
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"gopls",
|
||||
"pylsp",
|
||||
"ruff_lsp",
|
||||
"ts_ls",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
lsp_config = {}
|
||||
|
||||
if server_name == "pylsp" then
|
||||
lsp_config = {
|
||||
configs = {
|
||||
pylsp = {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
|
@ -108,10 +93,48 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
require('lspconfig')[server_name].setup(lsp_config)
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
-- Replace the language servers listed here
|
||||
-- with the ones you want to install
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"gopls",
|
||||
"pyright",
|
||||
"ruff_lsp",
|
||||
"ts_ls",
|
||||
"mypy"
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup(configs[server_name] or {})
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue