Esempio n. 1
0
        private async Task <ProjectChecksumObject> CreateProjectChecksumObjectAsync(ProjectState key, ProjectState projectState, string kind, CancellationToken cancellationToken)
        {
            var assetBuilder = new AssetBuilder(_checksumTree);
            var info         = await assetBuilder.BuildAsync(projectState, cancellationToken).ConfigureAwait(false);

            var subTreeNode        = _checksumTree.GetOrCreateSubTreeNode(key);
            var subSnapshotBuilder = new ChecksumTreeBuilder(subTreeNode);

            var documents = await subSnapshotBuilder.BuildAsync(projectState.DocumentStates, projectState.DocumentIds.Select(id => projectState.DocumentStates[id]), WellKnownChecksumObjects.Documents, cancellationToken).ConfigureAwait(false);

            var projectReferences = await subSnapshotBuilder.BuildAsync(projectState.ProjectReferences, projectState.ProjectReferences, cancellationToken).ConfigureAwait(false);

            var metadataReferences = await subSnapshotBuilder.BuildAsync(projectState.MetadataReferences, projectState.MetadataReferences, cancellationToken).ConfigureAwait(false);

            var analyzerReferences = await subSnapshotBuilder.BuildAsync(projectState.AnalyzerReferences, projectState.AnalyzerReferences, cancellationToken).ConfigureAwait(false);

            var additionalDocuments = await subSnapshotBuilder.BuildAsync(projectState.AdditionalDocumentStates, projectState.AdditionalDocumentIds.Select(id => projectState.AdditionalDocumentStates[id]), WellKnownChecksumObjects.TextDocuments, cancellationToken).ConfigureAwait(false);

            var subAssetBuilder    = new AssetBuilder(subTreeNode);
            var compilationOptions = await subAssetBuilder.BuildAsync(projectState, projectState.CompilationOptions, cancellationToken).ConfigureAwait(false);

            var parseOptions = await subAssetBuilder.BuildAsync(projectState, projectState.ParseOptions, cancellationToken).ConfigureAwait(false);

            return(new ProjectChecksumObject(
                       _serializer, info.Checksum, compilationOptions.Checksum, parseOptions.Checksum,
                       documents, projectReferences, metadataReferences, analyzerReferences, additionalDocuments));
        }
Esempio n. 2
0
        private async Task <DocumentChecksumObject> CreateDocumentChecksumObjectAsync(TextDocumentState key, TextDocumentState documentState, string kind, CancellationToken cancellationToken)
        {
            var assetBuilder = new AssetBuilder(_checksumTree);
            var info         = await assetBuilder.BuildAsync(documentState, cancellationToken).ConfigureAwait(false);

            var sourceText = await key.GetTextAsync(cancellationToken).ConfigureAwait(false);

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

            return(new DocumentChecksumObject(_serializer, info.Checksum, text.Checksum));
        }
Esempio n. 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));
        }
Esempio n. 4
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));
        }
Esempio n. 5
0
        private async Task <SolutionChecksumObject> CreateSolutionChecksumObjectAsync(SolutionState key, SolutionState solutionState, string kind, CancellationToken cancellationToken)
        {
            var assetBuilder = new AssetBuilder(_checksumTree);
            var info         = await assetBuilder.BuildAsync(solutionState, cancellationToken).ConfigureAwait(false);

            var subTreeNode        = _checksumTree.GetOrCreateSubTreeNode(key);
            var subSnapshotBuilder = new ChecksumTreeBuilder(subTreeNode);

            var projects = await subSnapshotBuilder.BuildAsync(solutionState.ProjectStates, solutionState.ProjectIds.Select(id => solutionState.ProjectStates[id]), cancellationToken).ConfigureAwait(false);

            return(new SolutionChecksumObject(_serializer, info.Checksum, projects));
        }
Esempio n. 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));
        }