File tree 2 files changed +10
-4
lines changed 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ local M = {
20
20
local start_char = rename .offset - vim .fn .line2byte (line ) + 1
21
21
local end_char = start_char + rename .length
22
22
23
- local name = ui .input ({ prompt = ' name ' } )
23
+ local name = ui .input (' Variable Name ' )
24
24
25
25
if not name then
26
26
return
Original file line number Diff line number Diff line change 1
1
local class = require (' java-core.utils.class' )
2
2
local notify = require (' java-core.utils.notify' )
3
+ local lsp_refactor_commands = require (' java-refactor.lsp-refactor-commands' )
3
4
4
5
local JdtlsClient = require (' java-core.ls.clients.jdtls-client' )
5
6
@@ -30,7 +31,6 @@ function RefactorCommands:extract_variable()
30
31
buffer
31
32
)
32
33
33
- vim .print (vim .lsp .handlers )
34
34
vim .lsp .util .apply_workspace_edit (edit .edit , ' utf-8' )
35
35
36
36
RefactorCommands .run_lsp_client_command (
@@ -40,14 +40,20 @@ function RefactorCommands:extract_variable()
40
40
end
41
41
42
42
function RefactorCommands .run_lsp_client_command (command_name , arguments )
43
- local command = vim .lsp .commands [command_name ]
43
+ local command
44
+
45
+ if lsp_refactor_commands [command_name ] then
46
+ command = lsp_refactor_commands [command_name ]
47
+ else
48
+ command = vim .lsp .commands [command_name ]
49
+ end
44
50
45
51
if not command then
46
52
notify .error (' Command "' .. command_name .. ' " is not supported' )
47
53
return
48
54
end
49
55
50
- vim . lsp . commands [ command_name ] (arguments )
56
+ command (arguments )
51
57
end
52
58
53
59
return RefactorCommands
You can’t perform that action at this time.
0 commit comments