navigation: don't show notification that nothing was found after cancel of the modal progress (IDEA-157671)

This commit is contained in:
Anna Kozlova
2016-07-01 17:22:59 +03:00
parent d553fd1f0d
commit ebc92ac640
3 changed files with 7 additions and 3 deletions
@@ -571,6 +571,9 @@ public class CtrlMouseHandler extends AbstractProjectComponent {
return PsiUtilCore.toPsiElementArray(found);
}
}.searchImplementations(editor, element, offset);
if (targetElements == null) {
return null;
}
if (targetElements.length > 1) {
PsiElement elementAtPointer = file.findElementAt(offset);
if (elementAtPointer != null) {
@@ -61,6 +61,7 @@ public class GotoImplementationHandler extends GotoTargetHandler {
return false;
}
}.searchImplementations(editor, source, offset);
if (targets == null) return null;
GotoData gotoData = new GotoData(source, targets, Collections.emptyList());
gotoData.listUpdaterTask = new ImplementationsUpdaterTask(gotoData, editor, offset, reference);
return gotoData;
@@ -40,7 +40,7 @@ public class ImplementationSearcher {
public static final String SEARCHING_FOR_IMPLEMENTATIONS = CodeInsightBundle.message("searching.for.implementations");
@NotNull
@Nullable
PsiElement[] searchImplementations(final Editor editor, final PsiElement element, final int offset) {
final TargetElementUtil targetElementUtil = TargetElementUtil.getInstance();
boolean onRef = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@@ -57,14 +57,14 @@ public class ImplementationSearcher {
}), onRef);
}
@NotNull
@Nullable
public PsiElement[] searchImplementations(final PsiElement element,
final Editor editor, final int offset,
final boolean includeSelfAlways,
final boolean includeSelfIfNoOthers) {
if (element == null) return PsiElement.EMPTY_ARRAY;
final PsiElement[] elements = searchDefinitions(element, editor);
if (elements == null) return PsiElement.EMPTY_ARRAY; //the search has been cancelled
if (elements == null) return null; //the search has been cancelled
if (elements.length > 0) {
if (!includeSelfAlways) return filterElements(element, elements, offset);
final PsiElement[] all;