From 6f7c522bbb4582aaae6d8b0725da038d1352ac2f Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 24 Apr 2015 14:39:27 +0200 Subject: [PATCH] read action (EA-67476 - assert: FileDocumentManagerImpl.getDocument) --- .../codeInsight/navigation/ImplementationSearcher.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/ImplementationSearcher.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/ImplementationSearcher.java index ae1baf02da10..2dad9117b22c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/ImplementationSearcher.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/ImplementationSearcher.java @@ -25,6 +25,7 @@ import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.search.PsiElementProcessor; import com.intellij.psi.search.PsiElementProcessorAdapter; @@ -77,7 +78,13 @@ public class ImplementationSearcher { } return filterElements(element, all, offset); } - return (includeSelfAlways || includeSelfIfNoOthers) && element.getTextRange() != null ? + return (includeSelfAlways || includeSelfIfNoOthers) && + ApplicationManager.getApplication().runReadAction(new Computable() { + @Override + public TextRange compute() { + return element.getTextRange(); + } + }) != null ? new PsiElement[] {element} : PsiElement.EMPTY_ARRAY; }