From bc4ad1218b908ec4efc3b0f6ea6e3cb4940b0084 Mon Sep 17 00:00:00 2001 From: Micah Effiong <52747707+micaiah-effiong@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:24:46 +0100 Subject: [PATCH] feat: added contexts for code action - source fix-all errors (#599) * feat: added contexts for code action - source fix-all errors * fix: resolve stylua checks * fix: resolve stylua checks --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 6c6ae02..c7e6400 100644 --- a/init.lua +++ b/init.lua @@ -514,7 +514,9 @@ local on_attach = function(_, bufnr) end nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + nmap('ca', function() + vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } } + end, '[C]ode [A]ction') nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')