add ruff for python
This commit is contained in:
@@ -72,7 +72,20 @@ vim.lsp.enable("gopls")
|
|||||||
-- pyright
|
-- pyright
|
||||||
vim.lsp.config("pyright", {
|
vim.lsp.config("pyright", {
|
||||||
capabilities = caps,
|
capabilities = caps,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
vim.lsp.enable("pyright")
|
||||||
|
|
||||||
|
-- ruff (linting + formatting)
|
||||||
|
vim.lsp.config("ruff", {
|
||||||
|
capabilities = caps,
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
-- leave hover to pyright
|
||||||
|
client.server_capabilities.hoverProvider = false
|
||||||
|
on_attach(client, bufnr)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.lsp.enable("ruff")
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
group = vim.api.nvim_create_augroup("AutoFormatOnSave", { clear = true }),
|
group = vim.api.nvim_create_augroup("AutoFormatOnSave", { clear = true }),
|
||||||
|
|||||||
Reference in New Issue
Block a user