1 write to SolutionState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SolutionCompilationState.cs (1)
70SolutionState = solution;
106 references to SolutionState
Microsoft.CodeAnalysis.Remote.ServiceHub (6)
Host\RemoteWorkspace.SolutionCreator.cs (1)
51var oldSolutionChecksums = await solution.CompilationState.SolutionState.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Host\SolutionAssetCache.cs (1)
178var solutionState = compilationState.SolutionState;
Host\TestUtils.cs (4)
201var solutionChecksums = await solution.CompilationState.SolutionState.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false); 203await solutionChecksums.FindAsync(solution.CompilationState.SolutionState, projectCone: null, AssetPath.FullLookupForTesting, Flatten(solutionChecksums), callback, map, cancellationToken).ConfigureAwait(false); 213var solutionChecksums = await solution.CompilationState.SolutionState.GetStateChecksumsAsync(projectId, cancellationToken).ConfigureAwait(false); 215await solutionChecksums.FindAsync(solution.CompilationState.SolutionState, projectCone, AssetPath.SolutionAndProjectForTesting(projectId), Flatten(solutionChecksums), callback, map, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Workspaces (99)
Workspace\Solution\Solution.cs (1)
70internal SolutionState SolutionState => CompilationState.SolutionState;
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
133/// cref="Compilation"/> provided to any clients of the <see cref="SolutionState"/> (for example, through 136/// stores extra information in it about that compilation that the <see cref="SolutionState"/> can be
Workspace\Solution\SolutionCompilationState.cs (80)
106public SolutionServices Services => this.SolutionState.Services; 116Contract.ThrowIfFalse(this.SolutionState.SortedProjectStates 132if (newSolutionState == this.SolutionState && 171if (stateChange.NewSolutionState == this.SolutionState) 321var newSolutionState = this.SolutionState.AddProjects(projectInfos); 361var newSolutionState = this.SolutionState.RemoveProjects(projectIds); 363var originalDependencyGraph = this.SolutionState.GetProjectDependencyGraph(); 405this.SolutionState.WithProjectAssemblyName(projectId, assemblyName), 416this.SolutionState.WithProjectOutputFilePath(projectId, outputFilePath), 426this.SolutionState.WithProjectOutputRefFilePath(projectId, outputRefFilePath), 436this.SolutionState.WithProjectCompilationOutputInfo(projectId, info), 446this.SolutionState.WithProjectDefaultNamespace(projectId, defaultNamespace), 456this.SolutionState.WithProjectChecksumAlgorithm(projectId, checksumAlgorithm), 467this.SolutionState.WithProjectName(projectId, name), 477this.SolutionState.WithProjectFilePath(projectId, filePath), 487this.SolutionState.WithProjectCompilationOptions(projectId, options), 496var stateChange = this.SolutionState.WithProjectParseOptions(projectId, options); 522this.SolutionState.WithHasAllInformation(projectId, hasAllInformation), 532this.SolutionState.WithRunAnalyzers(projectId, runAnalyzers), 542this.SolutionState.WithHasSdkCodeStyleAnalyzers(projectId, hasSdkCodeStyleAnalyzers), 552this.SolutionState.WithProjectDocumentsOrder(projectId, documentIds), 561var oldProject = SolutionState.GetRequiredProjectState(projectId); 599var projectStateWithUpdatedOptions = newState.SolutionState.GetRequiredProjectState(projectId); 661this.SolutionState.AddProjectReferences(projectId, projectReferences), 670this.SolutionState.RemoveProjectReference(projectId, projectReference), 680this.SolutionState.WithProjectReferences(projectId, projectReferences), 690this.SolutionState.AddMetadataReferences(projectId, metadataReferences), 699this.SolutionState.RemoveMetadataReference(projectId, metadataReference), 709this.SolutionState.WithProjectMetadataReferences(projectId, metadataReferences), 719return Branch(this.SolutionState.AddAnalyzerReferences(analyzerReferences)); 727return Branch(this.SolutionState.RemoveAnalyzerReference(analyzerReference)); 735return Branch(this.SolutionState.WithAnalyzerReferences(analyzerReferences)); 743this.SolutionState.WithProjectAnalyzerReferences(projectId, analyzerReferences), 776SolutionState.WithDocumentAttributes(documentId, arg, updateAttributes), documentId); 840var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 879var oldProjectState = newCompilationState.SolutionState.GetRequiredProjectState(projectId); 883var stateChange = newCompilationState.SolutionState.ForkProject( 938this.SolutionState.WithDocumentState(documentState), documentState.Id); 946this.SolutionState.WithAdditionalDocumentText(documentId, text, mode), documentId); 953return UpdateAnalyzerConfigDocumentState(this.SolutionState.WithAnalyzerConfigDocumentText(documentId, text, mode)); 958=> Branch(SolutionState.WithFallbackAnalyzerOptions(options)); 965this.SolutionState.WithDocumentText(documentId, textAndVersion, mode), documentId); 973this.SolutionState.WithAdditionalDocumentText(documentId, textAndVersion, mode), documentId); 981this.SolutionState.WithAnalyzerConfigDocumentText(documentId, textAndVersion, mode)); 1043this.SolutionState.WithDocumentSourceCodeKind(documentId, sourceCodeKind), documentId); 1050var stateChange = this.SolutionState.UpdateDocumentTextLoader(documentId, loader, mode); 1054Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1065var stateChange = this.SolutionState.UpdateAdditionalDocumentTextLoader(documentId, loader, mode); 1069Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1080var stateChange = this.SolutionState.UpdateAnalyzerConfigDocumentTextLoader(documentId, loader, mode); 1084Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1165tracker = RoslynImmutableInterlocked.GetOrAdd(ref _projectIdToTrackerMap, projectId, s_createCompilationTrackerFunction, this.SolutionState); 1179this.SolutionState.CheckContainsProject(projectId); 1196return GetCompilationAsync(this.SolutionState.GetProjectState(projectId)!, cancellationToken); 1357this.SolutionState.GetProjectDependencyGraph(), 1373this.SolutionState, 1422var projectState = this.SolutionState.GetRequiredProjectState(documentIdentity.DocumentId.ProjectId); 1451this.SolutionState.GetProjectDependencyGraph(), 1472(documentStatesByProjectId, this.SolutionState), 1478this.SolutionState, 1484=> this.Branch(this.SolutionState.WithNewWorkspaceFrom(oldSolution)); 1487=> this.Branch(this.SolutionState.WithOptions(options)); 1536this.SolutionState, 1548var dependencyGraph = SolutionState.CreateDependencyGraph(this.SolutionState.ProjectIds, sortedNewProjectStates); 1550var newState = this.SolutionState.Branch( 1572using var _ = ArrayBuilder<ProjectState>.GetInstance(this.SolutionState.SortedProjectStates.Length, out var newSortedProjectStatesBuilder); 1573newSortedProjectStatesBuilder.AddRange(this.SolutionState.SortedProjectStates); 1585var oldProjectState = this.SolutionState.GetRequiredProjectState(projectId); 1591oldTracker = CreateCompilationTracker(projectId, this.SolutionState); 1616var newProjectStates = projectStateChanged ? newSortedProjectStatesBuilder.ToImmutableAndClear() : this.SolutionState.SortedProjectStates; 1640var currentDocumentState = this.SolutionState.GetRequiredDocumentState(documentId); 1678var allDocumentIds = this.SolutionState.GetRelatedDocumentIds(documentId, includeDifferentLanguages); 1690var allDocumentIds = @this.SolutionState.GetRelatedDocumentIds(documentId, includeDifferentLanguages); 1699var documentState = @this.SolutionState.GetRequiredDocumentState(currentDocumentId); 1727var oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId); 1771SolutionState.CheckContainsProject(projectId); 1772var projectState = SolutionState.GetRequiredProjectState(projectId); 1805var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 1818var stateChange = SolutionState.ForkProject( 1862var documentState = this.SolutionState.GetProjectState(documentId.ProjectId)?.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
499var referencedProject = compilationState.SolutionState.GetProjectState(projectReference.ProjectId); 1050if (compilationState.SolutionState.ContainsProject(dependentProjectReference.ProjectId)) 1087if (compilationState.SolutionState.ContainsProject(dependentProjectReference.ProjectId))
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (3)
108var solution = compilationState.SolutionState; 319var telemetryCollector = compilationState.SolutionState.Services.GetService<ISourceGeneratorTelemetryCollectorWorkspaceService>(); 324var telemetryReporter = compilationState.SolutionState.Services.GetService<ISourceGeneratorTelemetryReporterWorkspaceService>();
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
204var services = compilationState.SolutionState.Services;
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
25var projectState = this.SolutionState.GetProjectState(documentId.ProjectId);
Workspace\Solution\SolutionCompilationState_Checksum.cs (6)
22/// <see cref="SolutionState"/>, as well as the checksums for <see cref="FrozenSourceGeneratedDocumentStates"/> 108using (Logger.LogBlock(FunctionId.SolutionCompilationState_ComputeChecksumsAsync, this.SolutionState.FilePath, cancellationToken)) 115solutionStateChecksum = await this.SolutionState.GetChecksumAsync(cancellationToken).ConfigureAwait(false); 120var stateChecksums = await this.SolutionState.GetStateChecksumsAsync(projectId, cancellationToken).ConfigureAwait(false); 125var serializer = this.SolutionState.Services.GetRequiredService<ISerializerService>(); 155foreach (var projectState in this.SolutionState.SortedProjectStates)
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
122var projectState = this.SolutionState.GetRequiredProjectState(projectId);
Workspace\Solution\StateChecksums.cs (1)
169var solutionState = compilationState.SolutionState;
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\SerializationValidator.cs (1)
218Contract.ThrowIfFalse(solution.CompilationState.SolutionState.TryGetStateChecksums(out var solutionObjectFromSolution));