feat!(lsp): add quickfix function
This commit is contained in:
parent
5a4b907f6e
commit
d130acc11e
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user