Include source set indicator in move target selection

Otherwise it's not possible to distinguish between test and main if a
package exists in both, as both would appear the same.
This commit is contained in:
Mathias Fussenegger 2023-06-13 16:30:10 +02:00 committed by Mathias Fußenegger
parent 3492d44b75
commit aebfc22877

View file

@ -282,7 +282,17 @@ local function move_file(command, code_action_params)
ui.pick_one_async(
destinations,
'Target package> ',
function(x) return x.project .. ' » ' .. (x.isParentOfSelectedFile and '* ' or '') .. x.displayName end,
function(x)
local name = x.project .. ' » ' .. (x.isParentOfSelectedFile and '* ' or '') .. x.displayName
if string.find(x.path, "src/main") then
name = "main » " .. name
elseif string.find(x.path, "src/test") then
name = "test » " .. name
else
name = x.path .. " » " .. name
end
return name
end,
function(x)
local move_params = {
moveKind = 'moveResource',