From 12f48f116939a4a7296e62f6a367c495c8f379b5 Mon Sep 17 00:00:00 2001 From: Anup Sebastian <56888132+anupjsebastian@users.noreply.github.com> Date: Thu, 30 Oct 2025 07:39:06 -0500 Subject: [PATCH] feat: flutter code actions --- lua/custom/plugins/flutter.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/custom/plugins/flutter.lua b/lua/custom/plugins/flutter.lua index 90a8e1ac..0d94dbfa 100644 --- a/lua/custom/plugins/flutter.lua +++ b/lua/custom/plugins/flutter.lua @@ -159,9 +159,17 @@ return { local opts = { buffer = true, silent = true } -- Flutter run/quit (instant, prompts for device) + vim.keymap.set('n', 'fr', 'FlutterRun', vim.tbl_extend('force', opts, { desc = '[F]lutter [R]un' })) vim.keymap.set('n', 'fq', 'FlutterQuit', vim.tbl_extend('force', opts, { desc = '[F]lutter [Q]uit' })) vim.keymap.set('n', 'fR', 'FlutterRestart', vim.tbl_extend('force', opts, { desc = '[F]lutter Hot [R]estart' })) + -- Code Actions (Cmd+. equivalent) - wrap, remove, extract widgets, etc. + vim.keymap.set('n', '.', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = 'Code Actions (Cmd+.)' })) + vim.keymap.set('v', '.', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = 'Code Actions (Cmd+.)' })) + -- Alternative: use the default LSP keymap + vim.keymap.set('n', 'gra', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = '[G]oto Code [A]ction' })) + vim.keymap.set('v', 'gra', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = '[G]oto Code [A]ction' })) + -- Device management vim.keymap.set('n', 'fd', 'FlutterDevices', vim.tbl_extend('force', opts, { desc = '[F]lutter [D]evices' })) vim.keymap.set('n', 'fe', 'FlutterEmulators', vim.tbl_extend('force', opts, { desc = '[F]lutter [E]mulators' }))