1 write to SolutionState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SolutionCompilationState.cs (1)
70SolutionState = solution;
110 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 (103)
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 (84)
106public SolutionServices Services => this.SolutionState.Services; 116Contract.ThrowIfFalse(this.SolutionState.SortedProjectStates 132if (newSolutionState == this.SolutionState && 171if (stateChange.NewSolutionState == this.SolutionState) 179/// except that it will still fork even if newSolutionState is unchanged from <see cref="SolutionState"/>. 332var newSolutionState = this.SolutionState.AddProjects(projectInfos); 372var newSolutionState = this.SolutionState.RemoveProjects(projectIds); 374var originalDependencyGraph = this.SolutionState.GetProjectDependencyGraph(); 416this.SolutionState.WithProjectAssemblyName(projectId, assemblyName), 427this.SolutionState.WithProjectOutputFilePath(projectId, outputFilePath), 437this.SolutionState.WithProjectOutputRefFilePath(projectId, outputRefFilePath), 447this.SolutionState.WithProjectCompilationOutputInfo(projectId, info), 457this.SolutionState.WithProjectDefaultNamespace(projectId, defaultNamespace), 467this.SolutionState.WithProjectChecksumAlgorithm(projectId, checksumAlgorithm), 478this.SolutionState.WithProjectName(projectId, name), 488this.SolutionState.WithProjectFilePath(projectId, filePath), 498this.SolutionState.WithProjectCompilationOptions(projectId, options), 507var stateChange = this.SolutionState.WithProjectParseOptions(projectId, options); 533this.SolutionState.WithHasAllInformation(projectId, hasAllInformation), 543this.SolutionState.WithRunAnalyzers(projectId, runAnalyzers), 553this.SolutionState.WithHasSdkCodeStyleAnalyzers(projectId, hasSdkCodeStyleAnalyzers), 563this.SolutionState.WithProjectDocumentsOrder(projectId, documentIds), 572var oldProject = SolutionState.GetRequiredProjectState(projectId); 610var projectStateWithUpdatedOptions = newState.SolutionState.GetRequiredProjectState(projectId); 672this.SolutionState.AddProjectReferences(projectId, projectReferences), 681this.SolutionState.RemoveProjectReference(projectId, projectReference), 691this.SolutionState.WithProjectReferences(projectId, projectReferences), 701this.SolutionState.AddMetadataReferences(projectId, metadataReferences), 710this.SolutionState.RemoveMetadataReference(projectId, metadataReference), 720this.SolutionState.WithProjectMetadataReferences(projectId, metadataReferences), 730return Branch(this.SolutionState.AddAnalyzerReferences(analyzerReferences)); 738return Branch(this.SolutionState.RemoveAnalyzerReference(analyzerReference)); 746return Branch(this.SolutionState.WithAnalyzerReferences(analyzerReferences)); 754this.SolutionState.WithProjectAnalyzerReferences(projectId, analyzerReferences), 787SolutionState.WithDocumentAttributes(documentId, arg, updateAttributes), documentId); 851var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 890var oldProjectState = newCompilationState.SolutionState.GetRequiredProjectState(projectId); 894var stateChange = newCompilationState.SolutionState.ForkProject( 949this.SolutionState.WithDocumentState(documentState), documentState.Id); 957this.SolutionState.WithAdditionalDocumentText(documentId, text, mode), documentId); 964return UpdateAnalyzerConfigDocumentState(this.SolutionState.WithAnalyzerConfigDocumentText(documentId, text, mode)); 969=> Branch(SolutionState.WithFallbackAnalyzerOptions(options)); 976this.SolutionState.WithDocumentText(documentId, textAndVersion, mode), documentId); 984this.SolutionState.WithAdditionalDocumentText(documentId, textAndVersion, mode), documentId); 992this.SolutionState.WithAnalyzerConfigDocumentText(documentId, textAndVersion, mode)); 1054this.SolutionState.WithDocumentSourceCodeKind(documentId, sourceCodeKind), documentId); 1061var stateChange = this.SolutionState.UpdateDocumentTextLoader(documentId, loader, mode); 1065Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1076var stateChange = this.SolutionState.UpdateAdditionalDocumentTextLoader(documentId, loader, mode); 1080Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1091var stateChange = this.SolutionState.UpdateAnalyzerConfigDocumentTextLoader(documentId, loader, mode); 1095Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1176tracker = RoslynImmutableInterlocked.GetOrAdd(ref _projectIdToTrackerMap, projectId, s_createCompilationTrackerFunction, this.SolutionState); 1190this.SolutionState.CheckContainsProject(projectId); 1207return GetCompilationAsync(this.SolutionState.GetProjectState(projectId)!, cancellationToken); 1368this.SolutionState.GetProjectDependencyGraph(), 1384this.SolutionState, 1433var projectState = this.SolutionState.GetRequiredProjectState(documentIdentity.DocumentId.ProjectId); 1462this.SolutionState.GetProjectDependencyGraph(), 1483(documentStatesByProjectId, this.SolutionState), 1489this.SolutionState, 1495=> this.Branch(this.SolutionState.WithNewWorkspaceFrom(oldSolution)); 1498=> this.Branch(this.SolutionState.WithOptions(options)); 1547this.SolutionState, 1559var dependencyGraph = SolutionState.CreateDependencyGraph(this.SolutionState.ProjectIds, sortedNewProjectStates); 1561var newState = this.SolutionState.Branch( 1583using var _ = ArrayBuilder<ProjectState>.GetInstance(this.SolutionState.SortedProjectStates.Length, out var newSortedProjectStatesBuilder); 1584newSortedProjectStatesBuilder.AddRange(this.SolutionState.SortedProjectStates); 1596var oldProjectState = this.SolutionState.GetRequiredProjectState(projectId); 1602oldTracker = CreateCompilationTracker(projectId, this.SolutionState); 1627var newProjectStates = projectStateChanged ? newSortedProjectStatesBuilder.ToImmutableAndClear() : this.SolutionState.SortedProjectStates; 1651var currentDocumentState = this.SolutionState.GetRequiredDocumentState(documentId); 1689var allDocumentIds = this.SolutionState.GetRelatedDocumentIds(documentId, includeDifferentLanguages); 1701var allDocumentIds = @this.SolutionState.GetRelatedDocumentIds(documentId, includeDifferentLanguages); 1710var documentState = @this.SolutionState.GetRequiredDocumentState(currentDocumentId); 1738var oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId); 1782SolutionState.CheckContainsProject(projectId); 1783var projectState = SolutionState.GetRequiredProjectState(projectId); 1816var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 1829var stateChange = SolutionState.ForkProject( 1861this.SolutionState.CheckContainsProject(projectToUpdate); 1872var projectToUpdateState = this.SolutionState.GetRequiredProjectState(projectToUpdate); 1877new(this.SolutionState, projectToUpdateState, projectToUpdateState), 1902var 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));