2 writes to DocumentStates
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\ProjectState.cs (2)
78DocumentStates = documentStates; 116DocumentStates = new TextDocumentStates<DocumentState>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions));
35 references to DocumentStates
Microsoft.CodeAnalysis.Workspaces (35)
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)
119_lazyLatestDocumentVersion = AsyncLazy.Create(static (self, c) => ComputeLatestDocumentVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c), arg: this); 120_lazyLatestDocumentTopLevelChangeVersion = AsyncLazy.Create(static (self, c) => ComputeLatestDocumentTopLevelChangeVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c), arg: this); 132typeof(TDocumentState) == typeof(DocumentState) ? DocumentStates : 140foreach (var (documentId, documentState) in this.DocumentStates.States)
Workspace\Solution\ProjectState_Checksum.cs (1)
47var documentChecksumsTask = DocumentStates.GetDocumentChecksumsAndIdsAsync(cancellationToken);
Workspace\Solution\SolutionCompilationState.cs (2)
879var oldDocumentStates = newDocumentStates.SelectAsArray(static (s, oldProjectState) => oldProjectState.DocumentStates.GetRequiredState(s.Id), oldProjectState); 1631var oldDocumentState = oldProjectState.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (4)
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()) 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)) 1245var documentState = projectState.DocumentStates.GetState(documentId); 1299var documentState = projectState.DocumentStates.GetState(documentId); 1333return projectState.DocumentStates.Contains(documentId);
Workspace\Workspace.cs (2)
1759var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ?? 1760projectChanges.NewProject.State.DocumentStates.GetState(documentId)!;