feat!(lsp): add quickfix function

This commit is contained in:
Fabrice Mouhartem 2024-10-22 14:19:19 +02:00
parent 5a4b907f6e
commit d130acc11e
Signed by: fmouhart
GPG Key ID: 2C5033B228CFE4E7

View File

@ -16,6 +16,15 @@ local on_attach = function(_, bufnr)
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed nmap('<leader>c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed
nmap('<leader>f', function() -- https://stackoverflow.com/a/74303272
vim.lsp.buf.code_action({
filter = function(a)
return a.isPreferred
end,
apply = true
})
end, 'code action: [F]ix'
)
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')