Editor (@NotNull Project project, @NotNull LanguageFileType fileType, Language dialect, @NotNull String text, boolean editable, @NotNull StructuralSearchProfile profile) { PsiFile codeFragment = profile.createCodeFragment(project, text, null); if (codeFragment == null) { codeFragment = createFileFragment(project, fileType, dialect, text); } final Document doc; if (codeFragment != null) { doc = PsiDocumentManager.getInstance(project).getDocument(codeFragment); assert doc != null : "code fragment element should be physical"; DaemonCodeAnalyzer.getInstance(project).setHighlightingEnabled(codeFragment, false); } else { doc = EditorFactory.getInstance().createDocument(""); } return createEditor(doc, project, editable, getTemplateContextType(profile)); }