Compare commits

...

2 Commits

Author SHA1 Message Date
17c2921c05
Change ruff lsp config 2024-10-14 10:42:30 +02:00
bd5ba8b971
Add ruff lsp to nvim 2024-10-14 10:39:30 +02:00
2 changed files with 33 additions and 0 deletions
home/editor/neovim

View File

@ -61,6 +61,7 @@
lua-language-server lua-language-server
clang-tools clang-tools
zls zls
ruff
]; ];
home.sessionVariables.EDITOR = "nvim"; home.sessionVariables.EDITOR = "nvim";
} }

View File

@ -127,7 +127,39 @@ lspconfig.rust_analyzer.setup {
} }
-- LSP: python -- LSP: python
-- Ruff server
lspconfig.ruff.setup({
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client == nil then
return
end
if client.name == 'ruff' then
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
end
end,
desc = 'LSP: Disable hover capability from Ruff',
})
-- Pyright
lspconfig.pyright.setup { lspconfig.pyright.setup {
settings = {
pyright = {
-- Using Ruff's import organizer
disableOrganizeImports = true,
},
python = {
analysis = {
-- Ignore all files for analysis to exclusively use Ruff for linting
ignore = { '*' },
},
},
},
} }
-- LSP: C/C++ -- LSP: C/C++