mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-89093 Copy reference is missing
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user