IDEA-157379 'Project Files Tree', copy references doesn't output same content with single or multiple files

use the old way if PSI_ELEMENT_ARRAY returns nothing, fix tests
This commit is contained in:
peter
2016-09-20 19:17:08 +02:00
parent 71ce421c99
commit cc0e4a2b9a
@@ -154,6 +154,10 @@ public class CopyReferenceAction extends DumbAwareAction {
}
}
if (elements.isEmpty()) {
ContainerUtil.addIfNotNull(elements, CommonDataKeys.PSI_ELEMENT.getData(dataContext));
}
if (elements.isEmpty() && editor == null) {
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext);