Editor (VirtualFile virtualFile) { FileEditor[] fileEditors = FileEditorManagerEx.getInstanceEx(getProject()).openFile(virtualFile, false); assertNotNull(fileEditors); assertEquals(1, fileEditors.length); Editor editor = ((TextEditor)fileEditors[0]).getEditor(); EditorTestUtil.waitForLoading(editor); return editor; }