public async Task FindAsync( SolutionState state, HashSet <Checksum> searchingChecksumsLeft, Dictionary <Checksum, object> result, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // verify input Contract.ThrowIfFalse(state.TryGetStateChecksums(out var stateChecksum)); Contract.ThrowIfFalse(this == stateChecksum); if (searchingChecksumsLeft.Remove(Checksum)) { result[Checksum] = this; } if (searchingChecksumsLeft.Remove(Attributes)) { result[Attributes] = state.SolutionAttributes; } if (searchingChecksumsLeft.Remove(Options)) { result[Options] = state.Options; } if (searchingChecksumsLeft.Remove(Projects.Checksum)) { result[Projects.Checksum] = Projects; } if (searchingChecksumsLeft.Remove(AnalyzerReferences.Checksum)) { result[AnalyzerReferences.Checksum] = AnalyzerReferences; } foreach (var(_, projectState) in state.ProjectStates) { // solution state checksum can't be created without project state checksums created first // check unsupported projects if (!projectState.TryGetStateChecksums(out var projectStateChecksums)) { Contract.ThrowIfTrue(RemoteSupportedLanguages.IsSupported(projectState.Language)); continue; } await projectStateChecksums.FindAsync(projectState, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); if (searchingChecksumsLeft.Count == 0) { break; } } ChecksumCollection.Find(state.AnalyzerReferences, AnalyzerReferences, searchingChecksumsLeft, result, cancellationToken); }
public async Task FindAsync( ProjectState state, HashSet <Checksum> searchingChecksumsLeft, Dictionary <Checksum, object> result, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // verify input Contract.ThrowIfFalse(state.TryGetStateChecksums(out var stateChecksum)); Contract.ThrowIfFalse(this == stateChecksum); if (searchingChecksumsLeft.Remove(Checksum)) { result[Checksum] = this; } if (searchingChecksumsLeft.Remove(Info)) { result[Info] = state.ProjectInfo.Attributes; } if (searchingChecksumsLeft.Remove(CompilationOptions)) { result[CompilationOptions] = state.CompilationOptions; } if (searchingChecksumsLeft.Remove(ParseOptions)) { result[ParseOptions] = state.ParseOptions; } if (searchingChecksumsLeft.Remove(Documents.Checksum)) { result[Documents.Checksum] = Documents; } if (searchingChecksumsLeft.Remove(ProjectReferences.Checksum)) { result[ProjectReferences.Checksum] = ProjectReferences; } if (searchingChecksumsLeft.Remove(MetadataReferences.Checksum)) { result[MetadataReferences.Checksum] = MetadataReferences; } if (searchingChecksumsLeft.Remove(AnalyzerReferences.Checksum)) { result[AnalyzerReferences.Checksum] = AnalyzerReferences; } if (searchingChecksumsLeft.Remove(AdditionalDocuments.Checksum)) { result[AdditionalDocuments.Checksum] = AdditionalDocuments; } if (searchingChecksumsLeft.Remove(AnalyzerConfigDocuments.Checksum)) { result[AnalyzerConfigDocuments.Checksum] = AnalyzerConfigDocuments; } ChecksumCollection.Find(state.ProjectReferences, ProjectReferences, searchingChecksumsLeft, result, cancellationToken); ChecksumCollection.Find(state.MetadataReferences, MetadataReferences, searchingChecksumsLeft, result, cancellationToken); ChecksumCollection.Find(state.AnalyzerReferences, AnalyzerReferences, searchingChecksumsLeft, result, cancellationToken); await ChecksumCollection.FindAsync(state.DocumentStates, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); await ChecksumCollection.FindAsync(state.AdditionalDocumentStates, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); await ChecksumCollection.FindAsync(state.AnalyzerConfigDocumentStates, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); }
public async Task FindAsync( SolutionState state, HashSet <Checksum> searchingChecksumsLeft, Dictionary <Checksum, object> result, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (searchingChecksumsLeft.Count == 0) { return; } // verify input if (searchingChecksumsLeft.Remove(Checksum)) { result[Checksum] = this; } if (searchingChecksumsLeft.Remove(Attributes)) { result[Attributes] = state.SolutionAttributes; } if (searchingChecksumsLeft.Remove(FrozenSourceGeneratedDocumentIdentity)) { Contract.ThrowIfNull(state.FrozenSourceGeneratedDocumentState, "We should not have had a FrozenSourceGeneratedDocumentIdentity checksum if we didn't have a text in the first place."); result[FrozenSourceGeneratedDocumentIdentity] = state.FrozenSourceGeneratedDocumentState.Identity; } if (searchingChecksumsLeft.Remove(FrozenSourceGeneratedDocumentText)) { Contract.ThrowIfNull(state.FrozenSourceGeneratedDocumentState, "We should not have had a FrozenSourceGeneratedDocumentState checksum if we didn't have a text in the first place."); result[FrozenSourceGeneratedDocumentText] = await SerializableSourceText.FromTextDocumentStateAsync(state.FrozenSourceGeneratedDocumentState, cancellationToken).ConfigureAwait(false); } if (searchingChecksumsLeft.Remove(Projects.Checksum)) { result[Projects.Checksum] = Projects; } if (searchingChecksumsLeft.Remove(AnalyzerReferences.Checksum)) { result[AnalyzerReferences.Checksum] = AnalyzerReferences; } foreach (var(_, projectState) in state.ProjectStates) { if (searchingChecksumsLeft.Count == 0) { break; } // It's possible not all all our projects have checksums. Specifically, we may have only been // asked to compute the checksum tree for a subset of projects that were all that a feature needed. if (projectState.TryGetStateChecksums(out var projectStateChecksums)) { await projectStateChecksums.FindAsync(projectState, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); } } ChecksumCollection.Find(state.AnalyzerReferences, AnalyzerReferences, searchingChecksumsLeft, result, cancellationToken); }
public async Task FindAsync( SolutionState state, HashSet <Checksum> searchingChecksumsLeft, Dictionary <Checksum, object> result, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // verify input Contract.ThrowIfFalse(state.TryGetStateChecksums(out var stateChecksum)); Contract.ThrowIfFalse(this == stateChecksum); if (searchingChecksumsLeft.Remove(Checksum)) { result[Checksum] = this; } if (searchingChecksumsLeft.Remove(Attributes)) { result[Attributes] = state.SolutionAttributes; } if (searchingChecksumsLeft.Remove(Options)) { result[Options] = state.Options; } if (searchingChecksumsLeft.Remove(FrozenSourceGeneratedDocumentIdentity)) { Contract.ThrowIfNull(state.FrozenSourceGeneratedDocumentState, "We should not have had a FrozenSourceGeneratedDocumentIdentity checksum if we didn't have a text in the first place."); result[FrozenSourceGeneratedDocumentIdentity] = state.FrozenSourceGeneratedDocumentState.Identity; } if (searchingChecksumsLeft.Remove(FrozenSourceGeneratedDocumentText)) { Contract.ThrowIfNull(state.FrozenSourceGeneratedDocumentState, "We should not have had a FrozenSourceGeneratedDocumentState checksum if we didn't have a text in the first place."); result[FrozenSourceGeneratedDocumentText] = await SerializableSourceText.FromTextDocumentStateAsync(state.FrozenSourceGeneratedDocumentState, cancellationToken).ConfigureAwait(false); } if (searchingChecksumsLeft.Remove(Projects.Checksum)) { result[Projects.Checksum] = Projects; } if (searchingChecksumsLeft.Remove(AnalyzerReferences.Checksum)) { result[AnalyzerReferences.Checksum] = AnalyzerReferences; } foreach (var(_, projectState) in state.ProjectStates) { // solution state checksum can't be created without project state checksums created first // check unsupported projects if (!projectState.TryGetStateChecksums(out var projectStateChecksums)) { Contract.ThrowIfTrue(RemoteSupportedLanguages.IsSupported(projectState.Language)); continue; } await projectStateChecksums.FindAsync(projectState, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); if (searchingChecksumsLeft.Count == 0) { break; } } ChecksumCollection.Find(state.AnalyzerReferences, AnalyzerReferences, searchingChecksumsLeft, result, cancellationToken); }
public async Task FindAsync( ProjectState state, HashSet <Checksum> searchingChecksumsLeft, Dictionary <Checksum, object> result, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // verify input Contract.ThrowIfFalse(state.TryGetStateChecksums(out var stateChecksum)); Contract.ThrowIfFalse(this == stateChecksum); if (searchingChecksumsLeft.Count == 0) { return; } if (searchingChecksumsLeft.Remove(Checksum)) { result[Checksum] = this; } if (searchingChecksumsLeft.Remove(Info)) { result[Info] = state.ProjectInfo.Attributes; } if (searchingChecksumsLeft.Remove(CompilationOptions)) { Contract.ThrowIfNull(state.CompilationOptions, "We should not be trying to serialize a project with no compilation options; RemoteSupportedLanguages.IsSupported should have filtered it out."); result[CompilationOptions] = state.CompilationOptions; } if (searchingChecksumsLeft.Remove(ParseOptions)) { Contract.ThrowIfNull(state.ParseOptions, "We should not be trying to serialize a project with no compilation options; RemoteSupportedLanguages.IsSupported should have filtered it out."); result[ParseOptions] = state.ParseOptions; } if (searchingChecksumsLeft.Remove(Documents.Checksum)) { result[Documents.Checksum] = Documents; } if (searchingChecksumsLeft.Remove(ProjectReferences.Checksum)) { result[ProjectReferences.Checksum] = ProjectReferences; } if (searchingChecksumsLeft.Remove(MetadataReferences.Checksum)) { result[MetadataReferences.Checksum] = MetadataReferences; } if (searchingChecksumsLeft.Remove(AnalyzerReferences.Checksum)) { result[AnalyzerReferences.Checksum] = AnalyzerReferences; } if (searchingChecksumsLeft.Remove(AdditionalDocuments.Checksum)) { result[AdditionalDocuments.Checksum] = AdditionalDocuments; } if (searchingChecksumsLeft.Remove(AnalyzerConfigDocuments.Checksum)) { result[AnalyzerConfigDocuments.Checksum] = AnalyzerConfigDocuments; } ChecksumCollection.Find(state.ProjectReferences, ProjectReferences, searchingChecksumsLeft, result, cancellationToken); ChecksumCollection.Find(state.MetadataReferences, MetadataReferences, searchingChecksumsLeft, result, cancellationToken); ChecksumCollection.Find(state.AnalyzerReferences, AnalyzerReferences, searchingChecksumsLeft, result, cancellationToken); await ChecksumCollection.FindAsync(state.DocumentStates, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); await ChecksumCollection.FindAsync(state.AdditionalDocumentStates, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); await ChecksumCollection.FindAsync(state.AnalyzerConfigDocumentStates, searchingChecksumsLeft, result, cancellationToken).ConfigureAwait(false); }