Beispiel #1
0
        private async Task <SolutionChecksumObject> CreateSolutionChecksumObjectAsync(
            Solution solution, string kind, SnapshotBuilder snapshotBuilder, AssetBuilder assetBuilder, CancellationToken cancellationToken)
        {
            var info = await assetBuilder.BuildAsync(solution, cancellationToken).ConfigureAwait(false);

            var projects = await snapshotBuilder.BuildAsync(solution, solution.Projects, cancellationToken).ConfigureAwait(false);

            return(new SolutionChecksumObject(_serializer, info.Checksum, projects));
        }
            public async Task <ChecksumScope> CreateChecksumAsync(Solution solution, CancellationToken cancellationToken)
            {
                // TODO: add logging mechanism
                var cache = _caches.CreateRootTreeNodeCache(solution);

                var builder  = new SnapshotBuilder(cache);
                var snapshot = new ChecksumScope(_caches, cache, await builder.BuildAsync(solution, cancellationToken).ConfigureAwait(false));

                return(snapshot);
            }
Beispiel #3
0
        private async Task <DocumentChecksumObject> CreateDocumentChecksumObjectAsync(
            TextDocument document, string kind, SnapshotBuilder snapshotBuilder, AssetBuilder assetBuilder, CancellationToken cancellationToken)
        {
            var info = await assetBuilder.BuildAsync(document, cancellationToken).ConfigureAwait(false);

            var state      = document.State;
            var sourceText = await state.GetTextAsync(cancellationToken).ConfigureAwait(false);

            var text = await assetBuilder.BuildAsync(state, sourceText, cancellationToken).ConfigureAwait(false);

            return(new DocumentChecksumObject(_serializer, info.Checksum, text.Checksum));
        }
Beispiel #4
0
            public override async Task <TChecksumObject> GetOrCreateChecksumObjectWithChildrenAsync <TKey, TValue, TChecksumObject>(
                TKey key, TValue value, string kind,
                Func <TValue, string, SnapshotBuilder, AssetBuilder, CancellationToken, Task <TChecksumObject> > valueGetterAsync, CancellationToken cancellationToken)
            {
                return(await GetOrCreateChecksumObjectAsync(key, value, kind, (v, k, c) =>
                {
                    var snapshotBuilder = new SnapshotBuilder(GetOrCreateSubTreeNodeCache(key));
                    var assetBuilder = new AssetBuilder(this);

                    return valueGetterAsync(v, k, snapshotBuilder, assetBuilder, c);
                }, cancellationToken).ConfigureAwait(false));
            }
Beispiel #5
0
            public async Task <ChecksumScope> CreateChecksumAsync(Solution solution, CancellationToken cancellationToken)
            {
                using (Logger.LogBlock(FunctionId.SolutionChecksumServiceFactory_CreateChecksumAsync, cancellationToken))
                {
                    var cache = _caches.CreateRootTreeNodeCache(solution);

                    var builder  = new SnapshotBuilder(cache);
                    var snapshot = new ChecksumScope(_caches, cache, await builder.BuildAsync(solution, cancellationToken).ConfigureAwait(false));

                    return(snapshot);
                }
            }
Beispiel #6
0
        private async Task <ProjectChecksumObject> CreateProjectChecksumObjectAsync(
            Project project, string kind, SnapshotBuilder snapshotBuilder, AssetBuilder assetBuilder, CancellationToken cancellationToken)
        {
            var info = await assetBuilder.BuildAsync(project, cancellationToken).ConfigureAwait(false);

            var compilationOptions = await assetBuilder.BuildAsync(project, project.CompilationOptions, cancellationToken).ConfigureAwait(false);

            var parseOptions = await assetBuilder.BuildAsync(project, project.ParseOptions, cancellationToken).ConfigureAwait(false);

            var documents = await snapshotBuilder.BuildAsync(project, project.Documents, WellKnownChecksumObjects.Documents, cancellationToken).ConfigureAwait(false);

            var projectReferences = await snapshotBuilder.BuildAsync(project, project.ProjectReferences, cancellationToken).ConfigureAwait(false);

            var metadataReferences = await snapshotBuilder.BuildAsync(project, project.MetadataReferences, cancellationToken).ConfigureAwait(false);

            var analyzerReferences = await snapshotBuilder.BuildAsync(project, project.AnalyzerReferences, cancellationToken).ConfigureAwait(false);

            var additionalDocuments = await snapshotBuilder.BuildAsync(project, project.AdditionalDocuments, WellKnownChecksumObjects.TextDocuments, cancellationToken).ConfigureAwait(false);

            return(new ProjectChecksumObject(
                       _serializer, info.Checksum, compilationOptions.Checksum, parseOptions.Checksum,
                       documents, projectReferences, metadataReferences, analyzerReferences, additionalDocuments));
        }
Beispiel #7
0
 private Task <ChecksumCollection> CreateChecksumCollectionsAsync(
     IEnumerable <AnalyzerReference> references, string kind, SnapshotBuilder snapshotBuilder, AssetBuilder assetBuilder, CancellationToken cancellationToken)
 {
     return(CreateChecksumCollectionsAsync(references, kind, assetBuilder.BuildAsync, cancellationToken));
 }
Beispiel #8
0
 private Task <ChecksumCollection> CreateDocumentChecksumObjectAsync(
     IEnumerable <TextDocument> documents, string kind, SnapshotBuilder snapshotBuilder, AssetBuilder assetBuilder, CancellationToken cancellationToken)
 {
     return(CreateChecksumCollectionsAsync(documents, kind, snapshotBuilder.BuildAsync, cancellationToken));
 }
Beispiel #9
0
 private Task <ChecksumCollection> CreateProjectChecksumCollectionAsync(
     IEnumerable <Project> projects, string kind, SnapshotBuilder snapshotBuilder, AssetBuilder assetBuilder, CancellationToken cancellationToken)
 {
     return(CreateChecksumCollectionsAsync(projects, kind, snapshotBuilder.BuildAsync, cancellationToken));
 }