Editor (@NotNull VirtualFile file) { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); Editor editor = FileEditorManager.getInstance(getProject()).openTextEditor(new OpenFileDescriptor(getProject(), file, 0), false); DaemonCodeAnalyzer.getInstance(getProject()).restart(); assertNotNull(editor); ((EditorImpl)editor).setCaretActive(); getIndexingMode().ensureIndexingStatus(getProject()); return editor; }