From cc0e4a2b9ab413cea0fef8dc77893f4b5103d344 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 20 Sep 2016 19:14:58 +0200 Subject: [PATCH] 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 --- .../src/com/intellij/ide/actions/CopyReferenceAction.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java b/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java index 8c4c77b02667..615bdbc31ffc 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java @@ -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);