private RecoverableSyntaxTree(AbstractSyntaxTreeFactoryService service, ProjectId cacheKey, CompilationUnitSyntax root, SyntaxTreeInfo info) { _recoverableRoot = new RecoverableSyntaxRoot <CompilationUnitSyntax>(service, root, this); _info = info; _projectCacheService = service.LanguageServices.WorkspaceServices.GetService <IProjectCacheHostService>(); _cacheKey = cacheKey; }
internal static SyntaxTree CreateRecoverableTree(AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> text, CompilationUnitSyntax root, bool reparse) { var recoverableRoot = CachedRecoverableSyntaxRoot <CompilationUnitSyntax> .Create(service, filePath, options, text, root, reparse); var recoverableTree = new RecoverableSyntaxTree(recoverableRoot); recoverableRoot.SetContainingTree(recoverableTree); return(recoverableTree); }
internal static SyntaxTree CreateRecoverableTree( AbstractSyntaxTreeFactoryService service, ProjectId cacheKey, string filePath, ParseOptions options, ValueSource <TextAndVersion> text, Encoding encoding, CompilationUnitSyntax root ) { return(new RecoverableSyntaxTree( service, cacheKey, root, new SyntaxTreeInfo(filePath, options, text, encoding, root.FullSpan.Length) )); }
internal static SyntaxTree CreateRecoverableTree(AbstractSyntaxTreeFactoryService service, ProjectId cacheKey, string filePath, ParseOptions options, ValueSource <TextAndVersion> text, CompilationUnitSyntax root) { return(root.AttributeLists.Any() || root.FullSpan.Length < service.MinimumLengthForRecoverableTree ? Create(root, (CSharpParseOptions)options, filePath, root.SyntaxTree.GetText().Encoding) : new RecoverableSyntaxTree(service, cacheKey, root, new SyntaxTreeInfo(filePath, options, text, root.FullSpan.Length))); }