This repository was archived by the owner on Nov 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 11local class = require (' java-core.utils.class' )
22local notify = require (' java-core.utils.notify' )
33local JdtlsClient = require (' java-core.ls.clients.jdtls-client' )
4+ local List = require (' java-core.utils.list' )
5+ local ui = require (' java.utils.ui' )
46
57local available_commands = {
68 -- 'assignField',
@@ -51,21 +53,37 @@ function RefactorCommands:refactor(refactor_type, context)
5153
5254 local buffer = vim .api .nvim_get_current_buf ()
5355
54- local selection = {}
56+ local selections = List : new ()
5557
5658 if
5759 context .range .start .character == context .range [' end' ].character
5860 and context .range .start .line == context .range [' end' ].line
5961 then
60- selection =
61- self .jdtls_client :java_infer_selection (refactor_type , context , buffer )
62+ local selection =
63+ self .jdtls_client :java_infer_selection (refactor_type , context , buffer )[1 ]
64+
65+ if refactor_type == ' extractField' then
66+ if selection .params and vim .islist (selection .params ) then
67+ local initialize_in =
68+ ui .select (' Initialize the field in' , selection .params )
69+
70+ if not initialize_in then
71+ return
72+ end
73+
74+ selections :push (initialize_in )
75+ end
76+ end
77+
78+ selections :push (selection )
79+ vim .print (selections )
6280 end
6381
6482 local edit = self .jdtls_client :java_get_refactor_edit (
6583 refactor_type ,
6684 context ,
6785 formatting_options ,
68- selection ,
86+ selections ,
6987 buffer
7088 )
7189
You can’t perform that action at this time.
0 commit comments