[nvim] move from pylps to pyright

This commit is contained in:
Piotr Domański 2024-10-17 22:58:51 +02:00
parent 58bdfd856c
commit 0d2f897a71

View file

@ -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,
}
})