summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-09-18 20:40:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-18 20:40:22 +0000
commit07d35c37ce79a64bdd905b394d40fc9bbb18fa60 (patch)
treee8787c45e494dfcc558faf0f75956f8785c39b94 /platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
parente222a9e1e66670a56e926a6b0f3e10231eeeb1fb (diff)
parentb5fb31ef6a38f19404859755dbd2e345215b97bf (diff)
downloadidea-07d35c37ce79a64bdd905b394d40fc9bbb18fa60.tar.gz
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java')
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
index afd7b230621c..376c24289617 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -367,12 +367,17 @@ public class ShowImplementationsAction extends AnAction implements PopupAction {
}
private static PsiElement[] filterElements(final PsiElement[] targetElements) {
- Set<PsiElement> unique = new LinkedHashSet<PsiElement>(Arrays.asList(targetElements));
- for (PsiElement elt : targetElements) {
- final PsiFile containingFile = elt.getContainingFile();
- LOG.assertTrue(containingFile != null, elt);
- PsiFile psiFile = containingFile.getOriginalFile();
- if (psiFile.getVirtualFile() == null) unique.remove(elt);
+ final Set<PsiElement> unique = new LinkedHashSet<PsiElement>(Arrays.asList(targetElements));
+ for (final PsiElement elt : targetElements) {
+ ApplicationManager.getApplication().runReadAction(new Runnable() {
+ @Override
+ public void run() {
+ final PsiFile containingFile = elt.getContainingFile();
+ LOG.assertTrue(containingFile != null, elt);
+ PsiFile psiFile = containingFile.getOriginalFile();
+ if (psiFile.getVirtualFile() == null) unique.remove(elt);
+ }
+ });
}
// special case for Python (PY-237)
// if the definition is the tree parent of the target element, filter out the target element
@@ -392,9 +397,9 @@ public class ShowImplementationsAction extends AnAction implements PopupAction {
}
private static class ImplementationsUpdaterTask extends BackgroundUpdaterTask<ImplementationViewComponent> {
- private String myCaption;
- private Editor myEditor;
- private PsiElement myElement;
+ private final String myCaption;
+ private final Editor myEditor;
+ private final PsiElement myElement;
private final boolean myIncludeSelf;
private PsiElement[] myElements;