1 write to SolutionState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SolutionCompilationState.cs (1)
70
SolutionState
= solution;
110 references to SolutionState
Microsoft.CodeAnalysis.Remote.ServiceHub (6)
Host\RemoteWorkspace.SolutionCreator.cs (1)
51
var oldSolutionChecksums = await solution.CompilationState.
SolutionState
.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Host\SolutionAssetCache.cs (1)
178
var solutionState = compilationState.
SolutionState
;
Host\TestUtils.cs (4)
201
var solutionChecksums = await solution.CompilationState.
SolutionState
.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
203
await solutionChecksums.FindAsync(solution.CompilationState.
SolutionState
, projectCone: null, AssetPath.FullLookupForTesting, Flatten(solutionChecksums), callback, map, cancellationToken).ConfigureAwait(false);
213
var solutionChecksums = await solution.CompilationState.
SolutionState
.GetStateChecksumsAsync(projectId, cancellationToken).ConfigureAwait(false);
215
await 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)
70
internal 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)
106
public SolutionServices Services => this.
SolutionState
.Services;
116
Contract.ThrowIfFalse(this.
SolutionState
.SortedProjectStates
132
if (newSolutionState == this.
SolutionState
&&
171
if (stateChange.NewSolutionState == this.
SolutionState
)
179
/// except that it will still fork even if newSolutionState is unchanged from <see cref="
SolutionState
"/>.
332
var newSolutionState = this.
SolutionState
.AddProjects(projectInfos);
372
var newSolutionState = this.
SolutionState
.RemoveProjects(projectIds);
374
var originalDependencyGraph = this.
SolutionState
.GetProjectDependencyGraph();
416
this.
SolutionState
.WithProjectAssemblyName(projectId, assemblyName),
427
this.
SolutionState
.WithProjectOutputFilePath(projectId, outputFilePath),
437
this.
SolutionState
.WithProjectOutputRefFilePath(projectId, outputRefFilePath),
447
this.
SolutionState
.WithProjectCompilationOutputInfo(projectId, info),
457
this.
SolutionState
.WithProjectDefaultNamespace(projectId, defaultNamespace),
467
this.
SolutionState
.WithProjectChecksumAlgorithm(projectId, checksumAlgorithm),
478
this.
SolutionState
.WithProjectName(projectId, name),
488
this.
SolutionState
.WithProjectFilePath(projectId, filePath),
498
this.
SolutionState
.WithProjectCompilationOptions(projectId, options),
507
var stateChange = this.
SolutionState
.WithProjectParseOptions(projectId, options);
533
this.
SolutionState
.WithHasAllInformation(projectId, hasAllInformation),
543
this.
SolutionState
.WithRunAnalyzers(projectId, runAnalyzers),
553
this.
SolutionState
.WithHasSdkCodeStyleAnalyzers(projectId, hasSdkCodeStyleAnalyzers),
563
this.
SolutionState
.WithProjectDocumentsOrder(projectId, documentIds),
572
var oldProject =
SolutionState
.GetRequiredProjectState(projectId);
610
var projectStateWithUpdatedOptions = newState.
SolutionState
.GetRequiredProjectState(projectId);
672
this.
SolutionState
.AddProjectReferences(projectId, projectReferences),
681
this.
SolutionState
.RemoveProjectReference(projectId, projectReference),
691
this.
SolutionState
.WithProjectReferences(projectId, projectReferences),
701
this.
SolutionState
.AddMetadataReferences(projectId, metadataReferences),
710
this.
SolutionState
.RemoveMetadataReference(projectId, metadataReference),
720
this.
SolutionState
.WithProjectMetadataReferences(projectId, metadataReferences),
730
return Branch(this.
SolutionState
.AddAnalyzerReferences(analyzerReferences));
738
return Branch(this.
SolutionState
.RemoveAnalyzerReference(analyzerReference));
746
return Branch(this.
SolutionState
.WithAnalyzerReferences(analyzerReferences));
754
this.
SolutionState
.WithProjectAnalyzerReferences(projectId, analyzerReferences),
787
SolutionState
.WithDocumentAttributes(documentId, arg, updateAttributes), documentId);
851
var oldProjectState =
SolutionState
.GetRequiredProjectState(projectId);
890
var oldProjectState = newCompilationState.
SolutionState
.GetRequiredProjectState(projectId);
894
var stateChange = newCompilationState.
SolutionState
.ForkProject(
949
this.
SolutionState
.WithDocumentState(documentState), documentState.Id);
957
this.
SolutionState
.WithAdditionalDocumentText(documentId, text, mode), documentId);
964
return UpdateAnalyzerConfigDocumentState(this.
SolutionState
.WithAnalyzerConfigDocumentText(documentId, text, mode));
969
=> Branch(
SolutionState
.WithFallbackAnalyzerOptions(options));
976
this.
SolutionState
.WithDocumentText(documentId, textAndVersion, mode), documentId);
984
this.
SolutionState
.WithAdditionalDocumentText(documentId, textAndVersion, mode), documentId);
992
this.
SolutionState
.WithAnalyzerConfigDocumentText(documentId, textAndVersion, mode));
1054
this.
SolutionState
.WithDocumentSourceCodeKind(documentId, sourceCodeKind), documentId);
1061
var stateChange = this.
SolutionState
.UpdateDocumentTextLoader(documentId, loader, mode);
1065
Debug.Assert(stateChange.NewSolutionState != this.
SolutionState
);
1076
var stateChange = this.
SolutionState
.UpdateAdditionalDocumentTextLoader(documentId, loader, mode);
1080
Debug.Assert(stateChange.NewSolutionState != this.
SolutionState
);
1091
var stateChange = this.
SolutionState
.UpdateAnalyzerConfigDocumentTextLoader(documentId, loader, mode);
1095
Debug.Assert(stateChange.NewSolutionState != this.
SolutionState
);
1176
tracker = RoslynImmutableInterlocked.GetOrAdd(ref _projectIdToTrackerMap, projectId, s_createCompilationTrackerFunction, this.
SolutionState
);
1190
this.
SolutionState
.CheckContainsProject(projectId);
1207
return GetCompilationAsync(this.
SolutionState
.GetProjectState(projectId)!, cancellationToken);
1368
this.
SolutionState
.GetProjectDependencyGraph(),
1384
this.
SolutionState
,
1433
var projectState = this.
SolutionState
.GetRequiredProjectState(documentIdentity.DocumentId.ProjectId);
1462
this.
SolutionState
.GetProjectDependencyGraph(),
1483
(documentStatesByProjectId, this.
SolutionState
),
1489
this.
SolutionState
,
1495
=> this.Branch(this.
SolutionState
.WithNewWorkspaceFrom(oldSolution));
1498
=> this.Branch(this.
SolutionState
.WithOptions(options));
1547
this.
SolutionState
,
1559
var dependencyGraph = SolutionState.CreateDependencyGraph(this.
SolutionState
.ProjectIds, sortedNewProjectStates);
1561
var newState = this.
SolutionState
.Branch(
1583
using var _ = ArrayBuilder<ProjectState>.GetInstance(this.
SolutionState
.SortedProjectStates.Length, out var newSortedProjectStatesBuilder);
1584
newSortedProjectStatesBuilder.AddRange(this.
SolutionState
.SortedProjectStates);
1596
var oldProjectState = this.
SolutionState
.GetRequiredProjectState(projectId);
1602
oldTracker = CreateCompilationTracker(projectId, this.
SolutionState
);
1627
var newProjectStates = projectStateChanged ? newSortedProjectStatesBuilder.ToImmutableAndClear() : this.
SolutionState
.SortedProjectStates;
1651
var currentDocumentState = this.
SolutionState
.GetRequiredDocumentState(documentId);
1689
var allDocumentIds = this.
SolutionState
.GetRelatedDocumentIds(documentId, includeDifferentLanguages);
1701
var allDocumentIds = @this.
SolutionState
.GetRelatedDocumentIds(documentId, includeDifferentLanguages);
1710
var documentState = @this.
SolutionState
.GetRequiredDocumentState(currentDocumentId);
1738
var oldProjectState = currentState.
SolutionState
.GetRequiredProjectState(documentId.ProjectId);
1782
SolutionState
.CheckContainsProject(projectId);
1783
var projectState =
SolutionState
.GetRequiredProjectState(projectId);
1816
var oldProjectState =
SolutionState
.GetRequiredProjectState(projectId);
1829
var stateChange =
SolutionState
.ForkProject(
1861
this.
SolutionState
.CheckContainsProject(projectToUpdate);
1872
var projectToUpdateState = this.
SolutionState
.GetRequiredProjectState(projectToUpdate);
1877
new(this.
SolutionState
, projectToUpdateState, projectToUpdateState),
1902
var documentState = this.
SolutionState
.GetProjectState(documentId.ProjectId)?.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
499
var referencedProject = compilationState.
SolutionState
.GetProjectState(projectReference.ProjectId);
1050
if (compilationState.
SolutionState
.ContainsProject(dependentProjectReference.ProjectId))
1087
if (compilationState.
SolutionState
.ContainsProject(dependentProjectReference.ProjectId))
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (3)
108
var solution = compilationState.
SolutionState
;
319
var telemetryCollector = compilationState.
SolutionState
.Services.GetService<ISourceGeneratorTelemetryCollectorWorkspaceService>();
324
var telemetryReporter = compilationState.
SolutionState
.Services.GetService<ISourceGeneratorTelemetryReporterWorkspaceService>();
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
204
var services = compilationState.
SolutionState
.Services;
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
25
var 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"/>
108
using (Logger.LogBlock(FunctionId.SolutionCompilationState_ComputeChecksumsAsync, this.
SolutionState
.FilePath, cancellationToken))
115
solutionStateChecksum = await this.
SolutionState
.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
120
var stateChecksums = await this.
SolutionState
.GetStateChecksumsAsync(projectId, cancellationToken).ConfigureAwait(false);
125
var serializer = this.
SolutionState
.Services.GetRequiredService<ISerializerService>();
155
foreach (var projectState in this.
SolutionState
.SortedProjectStates)
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
122
var projectState = this.
SolutionState
.GetRequiredProjectState(projectId);
Workspace\Solution\StateChecksums.cs (1)
169
var solutionState = compilationState.
SolutionState
;
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\SerializationValidator.cs (1)
218
Contract.ThrowIfFalse(solution.CompilationState.
SolutionState
.TryGetStateChecksums(out var solutionObjectFromSolution));