Skip to content

Commit 7fe5643

Browse files
committed
chore: code clean up
1 parent 0bae9a7 commit 7fe5643

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

lua/java-refactor/lsp-refactor-commands.lua

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,15 @@ local M = {
3636
---comment
3737
---@param command lsp.Command
3838
---@param params java-refactor.ApplyRefactoringCommandParams
39-
---@param command_info lsp.LSPAny
40-
['java.action.applyRefactoringCommand'] = function(
41-
command,
42-
params,
43-
command_info
44-
)
39+
['java.action.applyRefactoringCommand'] = function(command, params)
4540
runner(function()
46-
vim.print('params', params)
47-
vim.print('command_info', command_info)
4841
local refactor_type = command.arguments[1] --[[@as jdtls.CodeActionCommand]]
4942

5043
local client = vim.lsp.get_client_by_id(params.client_id)
5144

5245
---@type java-refactor.RefactorCommands
5346
local refactor_commands = RefactorCommands(client)
54-
refactor_commands:refactor(refactor_type, params.params, command_info)
47+
refactor_commands:refactor(refactor_type, params.params)
5548
end)
5649
.catch(get_error_handler('Failed to run refactoring command'))
5750
.run()

lua/java-refactor/refactor-commands.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,24 @@ function RefactorCommands:refactor(refactor_type, params)
5757
selections = self:get_selections(refactor_type, params)
5858
end
5959

60-
local edit = self.jdtls_client:java_get_refactor_edit(
60+
local changes = self.jdtls_client:java_get_refactor_edit(
6161
refactor_type,
6262
params,
6363
formatting_options,
6464
selections,
6565
vim.api.nvim_get_current_buf()
6666
)
6767

68-
if not edit then
68+
if not changes then
6969
notify.warn('No edits suggested for action')
7070
return
7171
end
7272

73-
vim.lsp.util.apply_workspace_edit(edit.edit, 'utf-8')
73+
vim.lsp.util.apply_workspace_edit(changes.edit, 'utf-8')
7474

7575
RefactorCommands.run_lsp_client_command(
76-
edit.command.command,
77-
edit.command.arguments
76+
changes.command.command,
77+
changes.command.arguments
7878
)
7979
end
8080

0 commit comments

Comments
 (0)