From 25098f1560786b78db02ff5092214cb7730568e7 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 20 Jul 2012 14:02:02 +0200 Subject: [PATCH] IDEA-89093 Copy reference is missing --- .../src/com/intellij/ide/actions/CopyReferenceAction.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 6e9eb784ada1..ce053353cb60 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java @@ -122,7 +122,8 @@ public class CopyReferenceAction extends AnAction { public void update(AnActionEvent e) { DataContext dataContext = e.getDataContext(); Editor editor = PlatformDataKeys.EDITOR.getData(dataContext); - boolean enabled = editor != null && (FileDocumentManager.getInstance().getFile(editor.getDocument()) != null || getElementToCopy(editor, dataContext) != null); + boolean enabled = (editor != null && FileDocumentManager.getInstance().getFile(editor.getDocument()) != null) || + getElementToCopy(editor, dataContext) != null; e.getPresentation().setEnabled(enabled); if (ActionPlaces.isPopupPlace(e.getPlace())) { e.getPresentation().setVisible(enabled); @@ -169,7 +170,7 @@ public class CopyReferenceAction extends AnAction { } @Nullable - private static PsiElement getElementToCopy(final Editor editor, final DataContext dataContext) { + private static PsiElement getElementToCopy(@Nullable final Editor editor, final DataContext dataContext) { PsiElement element = null; if (editor != null) { PsiReference reference = TargetElementUtilBase.findReference(editor);