PsiFile (final PsiFile psiFile, final Language templateLanguage, final CharSequence sourceCode, final TemplateLanguageFileViewProvider viewProvider, @NotNull TemplateDataElementType.RangeCollector rangeCollector) { CharSequence templateSourceCode = createTemplateText(sourceCode, createBaseLexer(viewProvider), rangeCollector); if (rangeCollector instanceof RangeCollectorImpl) { ((RangeCollectorImpl)rangeCollector).prepareFileForParsing(templateLanguage, sourceCode, templateSourceCode); } return createPsiFileFromSource(templateLanguage, templateSourceCode, psiFile.getManager()); }