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