51 lines
1.1 KiB
Lua
51 lines
1.1 KiB
Lua
|
-- here you can setup the language servers
|
||
|
|
||
|
local lsp_zero = require('lsp-zero')
|
||
|
|
||
|
lsp_zero.on_attach(function(client, bufnr)
|
||
|
-- see :help lsp-zero-keybindings
|
||
|
-- to learn the available actions
|
||
|
lsp_zero.default_keymaps({buffer = bufnr})
|
||
|
end)
|
||
|
|
||
|
-- to learn how to use mason.nvim
|
||
|
-- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guide/integrate-with-mason-nvim.md
|
||
|
require('mason').setup({})
|
||
|
require('mason-lspconfig').setup({
|
||
|
|
||
|
-- https://github.com/williamboman/mason-lspconfig.nvim?tab=readme-ov-file
|
||
|
ensure_installed = {
|
||
|
"pylsp",
|
||
|
"pyright",
|
||
|
},
|
||
|
handlers = {
|
||
|
function(server_name)
|
||
|
require('lspconfig')[server_name].setup({})
|
||
|
end,
|
||
|
},
|
||
|
})
|
||
|
|
||
|
require "lspconfig".pylsp.setup {
|
||
|
on_attach = on_attach,
|
||
|
settings = {
|
||
|
pylsp = {
|
||
|
plugins = {
|
||
|
flake8 = {
|
||
|
enabled = false,
|
||
|
maxLineLength = 119,
|
||
|
},
|
||
|
mypy = {
|
||
|
enabled = true,
|
||
|
},
|
||
|
pycodestyle = {
|
||
|
enabled = false,
|
||
|
},
|
||
|
pyflakes = {
|
||
|
enabled = false,
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|