feat(python): add key binding for organize imports

This commit is contained in:
MoetaYuko 2023-10-12 16:01:23 +08:00
parent 61f1c308bf
commit 45611aaec2

View file

@ -12,7 +12,23 @@ return {
opts = { opts = {
servers = { servers = {
pyright = {}, pyright = {},
ruff_lsp = {}, ruff_lsp = {
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports" },
diagnostics = {},
},
})
end,
desc = "Organize Imports",
},
},
},
}, },
setup = { setup = {
ruff_lsp = function() ruff_lsp = function()