public AbstractRecoverableSyntaxRoot( AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> text, TRoot root) { System.Diagnostics.Debug.Assert(service != null); System.Diagnostics.Debug.Assert(filePath != null); System.Diagnostics.Debug.Assert(options != null); System.Diagnostics.Debug.Assert(text != null); System.Diagnostics.Debug.Assert(root != null); this.service = service; this.filePath = filePath; this.options = options; this.textSource = text; this.length = root.FullSpan.Length; this.syntaxTreeCache = WorkspaceServices.GetService <ISyntaxTreeCacheService>(); System.Diagnostics.Debug.Assert(this.syntaxTreeCache != null); this.evictAction = new WeakAction <AbstractRecoverableSyntaxRoot <TRoot>, SyntaxNode>(this, (r, d) => r.OnEvicted(d)); this.rootSource = new ConstantValueSource <TRoot>(root); }
private RecoverableSyntaxRoot( RecoverableSyntaxRoot <TRoot> originalRoot, IRecoverableSyntaxTree <TRoot> containingTree) : base(originalRoot) { _service = originalRoot._service; _storage = originalRoot._storage; _containingTree = containingTree; }
public RecoverableSyntaxRoot( AbstractSyntaxTreeFactoryService service, TRoot root, IRecoverableSyntaxTree <TRoot> containingTree) : base(new ConstantValueSource <TRoot>(containingTree.CloneNodeAsRoot(root))) { _service = service; _containingTree = containingTree; }
public ReparsedSyntaxRoot( AbstractSyntaxTreeFactoryService service, string fileName, ParseOptions options, ValueSource <TextAndVersion> text, TRoot root) : base(service, fileName, options, text, root) { }
internal ReparsedSyntaxRoot( AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> textSource, ValueSource <TRoot> rootSource, int length) : base(service, filePath, options, textSource, rootSource, length) { }
internal ReplacedSyntaxRoot( AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> textSource, TRoot root) : base(service, filePath, options, textSource) { Debug.Assert(root != null); this.root = root; }
protected CachedRecoverableSyntaxRoot( AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> textSource, ValueSource <TRoot> rootSource, int length) : base(service, filePath, options, textSource) { this.rootSource = rootSource; this.length = length; this.syntaxTreeCache = service.languageServices.WorkspaceServices.GetService <ISyntaxTreeCacheService>(); this.evictAction = new WeakAction <CachedRecoverableSyntaxRoot <TRoot>, SyntaxNode>(this, (r, d) => r.OnEvicted(d)); }
protected RecoverableSyntaxRoot( AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> textSource) { Debug.Assert(service != null); Debug.Assert(filePath != null); Debug.Assert(options != null); Debug.Assert(textSource != null); this.Service = service; this.FilePath = filePath; this.Options = options; this.TextSource = textSource; }
public static CachedRecoverableSyntaxRoot <TRoot> Create( AbstractSyntaxTreeFactoryService service, string filePath, ParseOptions options, ValueSource <TextAndVersion> text, TRoot root, bool reparse) { var rootSource = new ConstantValueSource <TRoot>(root); int length = root.FullSpan.Length; if (reparse) { return(new ReparsedSyntaxRoot <TRoot>(service, filePath, options, text, rootSource, length)); } else { return(new SerializedSyntaxRoot <TRoot>(service, filePath, options, text, rootSource, length)); } }