3 instantiations of SolutionState
Microsoft.CodeAnalysis.Workspaces (3)
Workspace\Solution\Solution.cs (1)
42
: this(new
SolutionState
(workspace.Kind, workspace.PartialSemanticsEnabled, workspace.Services.SolutionServices, solutionAttributes, options, analyzerReferences))
Workspace\Solution\SolutionState.cs (2)
224
return new
SolutionState
(
260
return new
SolutionState
(
184 references to SolutionState
Microsoft.CodeAnalysis.Remote.Workspaces (4)
SolutionAssetStorage.cs (1)
62
var
solutionState = solution.State;
SolutionAssetStorage.Scope.cs (3)
23
public readonly
SolutionState
Solution;
39
SolutionState
solution)
129
var
solutionState = this.Solution;
Microsoft.CodeAnalysis.Workspaces (180)
Workspace\Host\PersistentStorage\ProjectKey.cs (1)
46
public static ProjectKey ToProjectKey(
SolutionState
solutionState, ProjectState projectState)
Workspace\Host\PersistentStorage\SolutionKey.cs (1)
34
public static SolutionKey ToSolutionKey(
SolutionState
solutionState)
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
276
private static void TryReportCompilationThrownAway(
SolutionState
solutionState, ProjectId projectId)
Workspace\Solution\Solution.cs (58)
30
private readonly
SolutionState
_state;
35
private Solution(
SolutionState
state)
46
internal
SolutionState
State => _state;
329
var
newState = _state.AddProject(projectInfo);
343
var
newState = _state.RemoveProject(projectId);
365
var
newState = _state.WithProjectAssemblyName(projectId, assemblyName);
381
var
newState = _state.WithProjectOutputFilePath(projectId, outputFilePath);
397
var
newState = _state.WithProjectOutputRefFilePath(projectId, outputRefFilePath);
413
var
newState = _state.WithProjectCompilationOutputInfo(projectId, info);
429
var
newState = _state.WithProjectDefaultNamespace(projectId, defaultNamespace);
445
var
newState = _state.WithProjectChecksumAlgorithm(projectId, checksumAlgorithm);
466
var
newState = _state.WithProjectName(projectId, name);
482
var
newState = _state.WithProjectFilePath(projectId, filePath);
504
var
newState = _state.WithProjectCompilationOptions(projectId, options);
526
var
newState = _state.WithProjectParseOptions(projectId, options);
544
var
newState = _state.WithHasAllInformation(projectId, hasAllInformation);
562
var
newState = _state.WithRunAnalyzers(projectId, runAnalyzers);
589
var
newState = _state.WithProjectDocumentsOrder(projectId, documentIds);
643
var
newState = _state.AddProjectReferences(projectId, collection);
668
var
newState = _state.RemoveProjectReference(projectId, projectReference);
697
var
newState = _state.WithProjectReferences(projectId, collection);
746
var
newState = _state.AddMetadataReferences(projectId, collection);
772
var
newState = _state.RemoveMetadataReference(projectId, metadataReference);
793
var
newState = _state.WithProjectMetadataReferences(
849
var
newState = _state.AddAnalyzerReferences(projectId, collection);
875
var
newState = _state.RemoveAnalyzerReference(projectId, analyzerReference);
896
var
newState = _state.WithProjectAnalyzerReferences(
940
var
newState = _state.AddAnalyzerReferences(collection);
962
var
newState = _state.RemoveAnalyzerReference(analyzerReference);
978
var
newState = _state.WithAnalyzerReferences(
1100
var
newState = _state.AddDocuments(documentInfos);
1146
var
newState = _state.AddAdditionalDocuments(documentInfos);
1206
var
newState = _state.AddAnalyzerConfigDocuments(documentInfos);
1235
var
newState = _state.RemoveDocuments(documentIds);
1264
var
newState = _state.RemoveAdditionalDocuments(documentIds);
1293
var
newState = _state.RemoveAnalyzerConfigDocuments(documentIds);
1314
var
newState = _state.WithDocumentName(documentId, name);
1331
var
newState = _state.WithDocumentFolders(documentId,
1357
var
newState = _state.WithDocumentFilePath(documentId, filePath);
1384
var
newState = _state.WithDocumentText(documentId, text, mode);
1411
var
newState = _state.WithAdditionalDocumentText(documentId, text, mode);
1438
var
newState = _state.WithAnalyzerConfigDocumentText(documentId, text, mode);
1465
var
newState = _state.WithDocumentText(documentId, textAndVersion, mode);
1492
var
newState = _state.WithAdditionalDocumentText(documentId, textAndVersion, mode);
1519
var
newState = _state.WithAnalyzerConfigDocumentText(documentId, textAndVersion, mode);
1546
var
newState = _state.WithDocumentSyntaxRoot(documentId, root, mode);
1557
var
newState = _state.WithDocumentContentsFrom(documentId, documentState);
1581
var
newState = _state.WithDocumentSourceCodeKind(documentId, sourceCodeKind);
1608
var
newState = _state.UpdateDocumentTextLoader(documentId, loader, mode);
1635
var
newState = _state.UpdateAdditionalDocumentTextLoader(documentId, loader, mode);
1662
var
newState = _state.UpdateAnalyzerConfigDocumentTextLoader(documentId, loader, mode);
1681
var
newState = _state.WithFrozenPartialCompilationIncludingSpecificDocument(documentId, cancellationToken);
1704
var
newState = _state.WithNewWorkspace(workspaceKind, workspaceVersion, services);
1744
var
newState = _state.WithDocumentText(documentIds, text, mode);
1760
var
newState = _state.WithFrozenSourceGeneratedDocument(documentIdentity, text);
1774
var
newState = _state.WithoutFrozenSourceGeneratedDocuments();
1793
var
newState = _state.WithCachedSourceGeneratorState(projectToUpdate, projectWithCachedGeneratorState);
1856
var
newState = _state.WithOptions(options: options);
Workspace\Solution\SolutionState.CompilationTracker.cs (23)
166
public ICompilationTracker FreezePartialStateWithTree(
SolutionState
solution, DocumentState docState, SyntaxTree tree, CancellationToken cancellationToken)
254
/// <see cref="BuildCompilationInfoAsync(
SolutionState
, CancellationToken)"/>.
261
SolutionState
solution,
398
public Task<Compilation> GetCompilationAsync(
SolutionState
solution, CancellationToken cancellationToken)
417
private async Task<Compilation> GetCompilationSlowAsync(
SolutionState
solution, CancellationToken cancellationToken)
424
SolutionState
solution,
471
SolutionState
solution,
517
SolutionState
solution,
588
SolutionState
solution, InProgressState state, Compilation inProgressCompilation, CancellationToken cancellationToken)
699
SolutionState
solution,
1028
public Task<bool> HasSuccessfullyLoadedAsync(
SolutionState
solution, CancellationToken cancellationToken)
1042
private async Task<bool> HasSuccessfullyLoadedSlowAsync(
SolutionState
solution, CancellationToken cancellationToken)
1048
public async ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(
SolutionState
solution, CancellationToken cancellationToken)
1060
public async ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(
SolutionState
solution, CancellationToken cancellationToken)
1134
public Task<VersionStamp> GetDependentVersionAsync(
SolutionState
solution, CancellationToken cancellationToken)
1138
var
tmp = solution; // temp. local to avoid a closure allocation for the fast path
1146
private async Task<VersionStamp> ComputeDependentVersionAsync(
SolutionState
solution, CancellationToken cancellationToken)
1167
public Task<VersionStamp> GetDependentSemanticVersionAsync(
SolutionState
solution, CancellationToken cancellationToken)
1171
var
tmp = solution; // temp. local to avoid a closure allocation for the fast path
1179
private async Task<VersionStamp> ComputeDependentSemanticVersionAsync(
SolutionState
solution, CancellationToken cancellationToken)
1198
public Task<Checksum> GetDependentChecksumAsync(
SolutionState
solution, CancellationToken cancellationToken)
1202
var
tmp = solution; // temp. local to avoid a closure allocation for the fast path
1210
private async Task<Checksum> ComputeDependentChecksumAsync(
SolutionState
solution, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.cs (74)
188
private
SolutionState
Branch(
246
public
SolutionState
WithNewWorkspace(
418
private static readonly Func<ProjectId,
SolutionState
, CompilationTracker> s_createCompilationTrackerFunction = CreateCompilationTracker;
420
private static CompilationTracker CreateCompilationTracker(ProjectId projectId,
SolutionState
solution)
437
private
SolutionState
AddProject(ProjectId projectId, ProjectState projectState)
481
public
SolutionState
AddProject(ProjectInfo projectInfo)
542
public
SolutionState
RemoveProject(ProjectId projectId)
619
public
SolutionState
WithProjectAssemblyName(ProjectId projectId, string assemblyName)
635
public
SolutionState
WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath)
651
public
SolutionState
WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath)
667
public
SolutionState
WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info)
683
public
SolutionState
WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace)
699
public
SolutionState
WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm)
715
public
SolutionState
WithProjectName(ProjectId projectId, string name)
731
public
SolutionState
WithProjectFilePath(ProjectId projectId, string? filePath)
748
public
SolutionState
WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options)
765
public
SolutionState
WithProjectParseOptions(ProjectId projectId, ParseOptions options)
791
public
SolutionState
WithHasAllInformation(ProjectId projectId, bool hasAllInformation)
809
public
SolutionState
WithRunAnalyzers(ProjectId projectId, bool runAnalyzers)
827
public
SolutionState
AddProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences)
848
public
SolutionState
RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
888
public
SolutionState
WithProjectReferences(ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences)
905
public
SolutionState
WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds)
936
public
SolutionState
AddMetadataReferences(ProjectId projectId, IReadOnlyCollection<MetadataReference> metadataReferences)
954
public
SolutionState
RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference)
971
public
SolutionState
WithProjectMetadataReferences(ProjectId projectId, IReadOnlyList<MetadataReference> metadataReferences)
987
public
SolutionState
AddAnalyzerReferences(ProjectId projectId, ImmutableArray<AnalyzerReference> analyzerReferences)
1007
public
SolutionState
RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
1026
public
SolutionState
WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
1058
public
SolutionState
AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1071
private
SolutionState
AddDocumentsToMultipleProjects<T>(
1091
var
newSolutionState = this;
1117
public
SolutionState
AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1124
public
SolutionState
AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
1136
public
SolutionState
RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
1150
public
SolutionState
RemoveDocuments(ImmutableArray<DocumentId> documentIds)
1157
private
SolutionState
RemoveDocumentsFromMultipleProjects<T>(
1172
var
newSolutionState = this;
1205
public
SolutionState
RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
1215
public
SolutionState
WithDocumentName(DocumentId documentId, string name)
1230
public
SolutionState
WithDocumentFolders(DocumentId documentId, IReadOnlyList<string> folders)
1244
public
SolutionState
WithDocumentFilePath(DocumentId documentId, string? filePath)
1259
public
SolutionState
WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1274
public
SolutionState
WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1289
public
SolutionState
WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1304
public
SolutionState
WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1319
public
SolutionState
WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1334
public
SolutionState
WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1349
public
SolutionState
WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue)
1362
public
SolutionState
WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState)
1394
public
SolutionState
WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
1405
public
SolutionState
UpdateDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1418
public
SolutionState
UpdateAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1431
public
SolutionState
UpdateAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1440
private
SolutionState
UpdateDocumentState(DocumentState newDocument, bool contentChanged)
1457
private
SolutionState
UpdateAdditionalDocumentState(AdditionalDocumentState newDocument, bool contentChanged)
1472
private
SolutionState
UpdateAnalyzerConfigDocumentState(AnalyzerConfigDocumentState newDocument)
1490
private
SolutionState
ForkProject(
1572
public
SolutionState
WithOptions(SolutionOptionSet options)
1575
public
SolutionState
AddAnalyzerReferences(IReadOnlyCollection<AnalyzerReference> analyzerReferences)
1587
public
SolutionState
RemoveAnalyzerReference(AnalyzerReference analyzerReference)
1599
public
SolutionState
WithAnalyzerReferences(IReadOnlyList<AnalyzerReference> analyzerReferences)
1620
private WeakReference<
SolutionState
>? _latestSolutionWithPartialCompilation;
1632
public
SolutionState
WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken)
1653
SolutionState
? currentPartialSolution = null;
1686
_latestSolutionWithPartialCompilation = new WeakReference<
SolutionState
>(currentPartialSolution);
1727
private static ImmutableArray<DocumentId> FilterDocumentIdsByLanguage(
SolutionState
solution, ImmutableArray<DocumentId> documentIds, string language)
1745
public
SolutionState
WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode)
1747
var
solution = this;
1852
public
SolutionState
WithFrozenSourceGeneratedDocument(SourceGeneratedDocumentIdentity documentIdentity, SourceText sourceText)
1908
public
SolutionState
WithoutFrozenSourceGeneratedDocuments()
1930
public
SolutionState
WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
2065
private readonly
SolutionState
_solutionState;
2067
public TestAccessor(
SolutionState
solutionState)
Workspace\Solution\SolutionState.GeneratedFileReplacingCompilationTracker.cs (10)
69
public ICompilationTracker FreezePartialStateWithTree(
SolutionState
solution, DocumentState docState, SyntaxTree tree, CancellationToken cancellationToken)
75
public async Task<Compilation> GetCompilationAsync(
SolutionState
solution, CancellationToken cancellationToken)
113
public Task<VersionStamp> GetDependentVersionAsync(
SolutionState
solution, CancellationToken cancellationToken)
116
public Task<VersionStamp> GetDependentSemanticVersionAsync(
SolutionState
solution, CancellationToken cancellationToken)
119
public Task<Checksum> GetDependentChecksumAsync(
SolutionState
solution, CancellationToken cancellationToken)
123
var
tmp = solution; // temp. local to avoid a closure allocation for the fast path
131
private async Task<Checksum> ComputeDependentChecksumAsync(
SolutionState
solution, CancellationToken cancellationToken)
148
public async ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(
SolutionState
solution, CancellationToken cancellationToken)
168
public Task<bool> HasSuccessfullyLoadedAsync(
SolutionState
solution, CancellationToken cancellationToken)
191
public ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(
SolutionState
solution, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.ICompilationTracker.cs (8)
38
ICompilationTracker FreezePartialStateWithTree(
SolutionState
solution, DocumentState docState, SyntaxTree tree, CancellationToken cancellationToken);
39
Task<Compilation> GetCompilationAsync(
SolutionState
solution, CancellationToken cancellationToken);
41
Task<VersionStamp> GetDependentVersionAsync(
SolutionState
solution, CancellationToken cancellationToken);
42
Task<VersionStamp> GetDependentSemanticVersionAsync(
SolutionState
solution, CancellationToken cancellationToken);
43
Task<Checksum> GetDependentChecksumAsync(
SolutionState
solution, CancellationToken cancellationToken);
46
ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(
SolutionState
solution, CancellationToken cancellationToken);
47
ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(
SolutionState
solution, CancellationToken cancellationToken);
49
Task<bool> HasSuccessfullyLoadedAsync(
SolutionState
solution, CancellationToken cancellationToken);
Workspace\Solution\SolutionState.SkeletonReferenceCache.cs (3)
133
SolutionState
solution,
148
SolutionState
solution,
178
SolutionState
solution,
Workspace\Solution\StateChecksums.cs (1)
39
SolutionState
state,