void () { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); if (getEditor() instanceof EditorWindow) { Document document = ((DocumentWindow)getEditor().getDocument()).getDelegate(); myFile = PsiDocumentManager.getInstance(getProject()).getPsiFile(document); myEditor = ((EditorWindow)getEditor()).getDelegate(); myVFile = myFile.getVirtualFile(); } }