Moving mouse over kt file while indexing in progress produces IndexNotReadyException
This commit is contained in:
@@ -25,6 +25,7 @@ import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEvent;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEventArea;
|
||||
import com.intellij.openapi.editor.event.EditorMouseMotionAdapter;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -67,6 +68,10 @@ public class DeclarationHintSupport extends AbstractProjectComponent {
|
||||
PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument());
|
||||
if (psiFile == null || psiFile.getLanguage() != JetLanguage.INSTANCE) return;
|
||||
|
||||
if (DumbService.getInstance(psiFile.getProject()).isDumb()) {
|
||||
return;
|
||||
}
|
||||
|
||||
JetFile jetFile = (JetFile) psiFile;
|
||||
|
||||
int offset = editor.logicalPositionToOffset(editor.xyToLogicalPosition(e.getMouseEvent().getPoint()));
|
||||
|
||||
Reference in New Issue
Block a user