Editor (Project project, PsiFile targetFile, PsiElement element) { TextRange range = element.getTextRange(); int textOffset = range.getStartOffset(); VirtualFile vFile = targetFile.getVirtualFile(); assert vFile != null; OpenFileDescriptor descriptor = new OpenFileDescriptor(project, vFile, textOffset); return FileEditorManager.getInstance(project).openTextEditor(descriptor, true); }