From e34e1078a63cc0cfa1d3aa4148ad0a28a4432402 Mon Sep 17 00:00:00 2001 From: Alex Liang Date: Thu, 4 Jun 2026 23:24:57 -0400 Subject: [PATCH] fix(refactor): use method-call syntax for Action:rename client-command-handlers.lua:21 used action.rename(params) (dot) instead of action:rename(params) (colon). Since Action:rename is defined with self, the dot-call passed params as self and left the actual params argument as nil, causing action.lua:28 to error with "bad argument #1 to 'ipairs' (table expected, got nil)". All other handlers in this file already use : when calling into Action:* methods. This brings RENAME_COMMAND in line with them. Reproduction: in any Java file with jdtls attached, trigger a refactoring that produces a follow-up rename (e.g. "Extract to constant" on a string literal). jdtls fires RENAME_COMMAND with the new symbol's location, and the handler errors before the rename UI opens. After this fix, the rename UI opens as expected. Co-Authored-By: Claude Opus 4.7 (1M context) --- lua/java-refactor/client-command-handlers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/java-refactor/client-command-handlers.lua b/lua/java-refactor/client-command-handlers.lua index 905a998..497ccde 100644 --- a/lua/java-refactor/client-command-handlers.lua +++ b/lua/java-refactor/client-command-handlers.lua @@ -18,7 +18,7 @@ local M = { ---@param params java-refactor.RenameAction[] [ClientCommand.RENAME_COMMAND] = function(params) run('Failed to rename the symbol', function(action) - action.rename(params) + action:rename(params) end) end,