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);
            }
Пример #2
0
 private RecoverableSyntaxRoot(
     RecoverableSyntaxRoot <TRoot> originalRoot,
     IRecoverableSyntaxTree <TRoot> containingTree)
     : base(originalRoot)
 {
     _service        = originalRoot._service;
     _storage        = originalRoot._storage;
     _containingTree = containingTree;
 }
Пример #3
0
 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)
 {
 }
Пример #5
0
 internal ReparsedSyntaxRoot(
     AbstractSyntaxTreeFactoryService service,
     string filePath,
     ParseOptions options,
     ValueSource <TextAndVersion> textSource,
     ValueSource <TRoot> rootSource,
     int length)
     : base(service, filePath, options, textSource, rootSource, length)
 {
 }
Пример #6
0
 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;
 }
Пример #7
0
 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));
 }
Пример #8
0
            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;
            }
Пример #9
0
            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));
                }
            }