Add ruff python linter

main
Nick Zana 3 months ago
parent 13e2f31a86
commit 03450108b3

@ -69,9 +69,33 @@ lsp.configure('clangd', {})
lsp.configure('pylsp', {})
-- From https://docs.astral.sh/ruff/editors/setup/#neovim
lsp.configure('ruff', {
init_options = {
settings = {
-- Ruff language server settings go here
}
}
})
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',
})
-- gopls
lsp.configure('gopls', {})
lsp.setup_servers({'rust_analyzer', 'html', 'texlab', 'clangd', 'pylsp', 'gopls', 'ts_ls'})
lsp.setup_servers({'rust_analyzer', 'html', 'texlab', 'clangd', 'pylsp', 'gopls', 'ts_ls', 'ruff'})
lsp.setup()

Loading…
Cancel
Save