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 11:43:07 -0700
committerTor Norbye <tnorbye@google.com>2014-09-18 11:43:28 -0700
commite782c57d74000722f9db4c9426317410520670c6 (patch)
tree6e5d3e8934107ffabb7661f8bfc0e1a08eb37faf /platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
parentc3d3a90f6b4ead083d63e28e6b9fcea93d675678 (diff)
downloadidea-e782c57d74000722f9db4c9426317410520670c6.tar.gz
Snapshot idea/138.2210 from git://git.jetbrains.org/idea/community.git
Change-Id: I8f0204d7887ee78cf1fd8c09f936c5afff0edd2f
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;