config(nvim): bring back pyright

main
sudo pacman -Syu 2024-08-15 01:22:19 +07:00
parent 57246bcfc6
commit fa80351fde
2 changed files with 26 additions and 1 deletions

View File

@ -563,12 +563,36 @@ require("lazy").setup({
}) })
-- Python -- Python
-- https://github.com/astral-sh/ruff/blob/main/crates/ruff_server/docs/setup/NEOVIM.md -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#pyright
lspconfig.pyright.setup({
capabilities = capabilities,
on_init = function(client, initialization_result)
if client.server_capabilities then
client.server_capabilities.semanticTokensProvider = nil
end
end,
settings = {
pyright = {
-- Conflicts with Ruff
disableOrganizeImports = true,
},
python = {
analysis = {
-- Conflicts with Ruff
ignore = { "*" },
},
},
},
})
-- https://docs.astral.sh/ruff/editors/setup/#neovim
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#ruff -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#ruff
lspconfig.ruff.setup({ lspconfig.ruff.setup({
on_init = function(client, initialization_result) on_init = function(client, initialization_result)
if client.server_capabilities then if client.server_capabilities then
client.server_capabilities.semanticTokensProvider = nil client.server_capabilities.semanticTokensProvider = nil
-- Conflicts with pyright
client.server_capabilities.hoverProvider = false
end end
end, end,
}) })

View File

@ -4,4 +4,5 @@ rye
rye install uv rye install uv
rye install ruff rye install ruff
rye install pyright
rye install keymap-drawer rye install keymap-drawer