private CompositeElement BuildIncludedT4Tree([NotNull] IPsiSourceFile target) { var lexer = LexerSelector.SelectLexer(target); // We need to parse File here, not IncludedFile, // because File makes some important error recovery and token reinsertion var parser = new T4Parser(lexer, target, PhysicalSourceFile, LexerSelector, Context); return(IncludedFile.FromOtherNode(parser.ParseFileWithoutCleanup())); }
private CompositeElement BuildIncludedT4Tree([NotNull] IPsiSourceFile target) { var languageService = T4Language.Instance.LanguageService().NotNull(); var lexer = languageService.GetPrimaryLexerFactory().CreateLexer(target.Document.Buffer); // We need to parse File here, not IncludedFile, // because File makes some important error recovery and token reinsertion return(IncludedFile.FromOtherNode(new T4Parser(lexer, target, PhysicalSourceFile, Context) .ParseFileWithoutCleanup())); }