2 writes to DocumentStates
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\ProjectState.cs (2)
79DocumentStates = documentStates; 120DocumentStates = new TextDocumentStates<DocumentState>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions));
36 references to DocumentStates
Microsoft.CodeAnalysis.Workspaces (36)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
58var regularDocumentStates = project.State.DocumentStates;
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
94var textChecksumsTasks = projectState.DocumentStates.States.Values.OrderBy(state => state.FilePath, StringComparer.Ordinal).Select(async state =>
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
304foreach (var (_, documentState) in projectState.DocumentStates.States)
Workspace\Solution\Project.cs (4)
175public bool HasDocuments => !State.DocumentStates.IsEmpty; 180public IReadOnlyList<DocumentId> DocumentIds => State.DocumentStates.Ids; 212=> State.DocumentStates.Contains(documentId); 466(documentId, project) => project.State.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null;
Workspace\Solution\ProjectChanges.cs (6)
100=> NewProject.State.DocumentStates.GetAddedStateIds(OldProject.State.DocumentStates); 130=> NewProject.State.DocumentStates.GetChangedStateIds(OldProject.State.DocumentStates, onlyGetDocumentsWithTextChanges, ignoreUnchangeableDocuments); 150=> NewProject.State.DocumentStates.GetRemovedStateIds(OldProject.State.DocumentStates);
Workspace\Solution\ProjectState.cs (4)
123_lazyLatestDocumentVersion = AsyncLazy.Create(static (self, c) => ComputeLatestDocumentVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c), arg: this); 124_lazyLatestDocumentTopLevelChangeVersion = AsyncLazy.Create(static (self, c) => ComputeLatestDocumentTopLevelChangeVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c), arg: this); 139typeof(TDocumentState) == typeof(DocumentState) ? DocumentStates : 147foreach (var (documentId, documentState) in this.DocumentStates.States)
Workspace\Solution\ProjectState_Checksum.cs (1)
47var documentChecksumsTask = DocumentStates.GetDocumentChecksumsAndIdsAsync(cancellationToken);
Workspace\Solution\SolutionCompilationState.cs (2)
901var oldDocumentStates = newDocumentStates.SelectAsArray(static (s, oldProjectState) => oldProjectState.DocumentStates.GetRequiredState(s.Id), oldProjectState); 1630var oldDocumentState = oldProjectState.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (5)
33state => string.Join(",", state.AssemblyName, state.DocumentStates.Count); 323foreach (var chunk in this.ProjectState.DocumentStates.GetStatesInCompilationOrder().Chunk(TranslationAction.AddDocumentsAction.AddDocumentsBatchSize)) 767foreach (var documentState in this.ProjectState.DocumentStates.GetStatesInCompilationOrder()) 955capacity: projectState.DocumentStates.Count + generatorInfo?.Documents.Count ?? 0 959foreach (var documentInProjectState in projectState.DocumentStates.States)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
255foreach (var documentState in ProjectState.DocumentStates.States)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
27var document = projectState.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionState.cs (7)
276this.GetProjectState(documentId.ProjectId)!.DocumentStates.Contains(documentId); 302=> GetRequiredProjectState(documentId.ProjectId).DocumentStates.GetRequiredState(documentId); 808if (documentIds.Count != oldProject.DocumentStates.Count) 815if (!oldProject.DocumentStates.Contains(id)) 1280var documentState = projectState.DocumentStates.GetState(documentId); 1334var documentState = projectState.DocumentStates.GetState(documentId); 1368return projectState.DocumentStates.Contains(documentId);
Workspace\Workspace.cs (2)
1717var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ?? 1718projectChanges.NewProject.State.DocumentStates.GetState(documentId)!;