Skip to content

Commit 301a1a3

Browse files
micaiah-effiongangerborn
authored andcommitted
feat: added contexts for code action - source fix-all errors (nvim-lua#599)
* feat: added contexts for code action - source fix-all errors * fix: resolve stylua checks * fix: resolve stylua checks
1 parent eee41e8 commit 301a1a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ local on_attach = function(_, bufnr)
514514
end
515515

516516
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
517-
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
517+
nmap('<leader>ca', function()
518+
vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } }
519+
end, '[C]ode [A]ction')
518520

519521
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
520522
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')

0 commit comments

Comments
 (0)