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));
57 references to DocumentStates
Microsoft.CodeAnalysis.Workspaces (57)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
79var 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)
324foreach (var (_, documentState) in projectState.DocumentStates.States)
Workspace\Solution\Project.cs (4)
177public bool HasDocuments => !State.DocumentStates.IsEmpty; 182public IReadOnlyList<DocumentId> DocumentIds => State.DocumentStates.Ids; 214=> State.DocumentStates.Contains(documentId); 496(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 (20)
119_lazyLatestDocumentVersion = AsyncLazy.Create(static async (self, c) => await ComputeLatestDocumentVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c).ConfigureAwait(false), 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) 399if (documentId != null && projectState.DocumentStates.TryGetState(documentId, out var documentState)) 471if (documentId != null && projectState.DocumentStates.TryGetState(documentId, out var documentState)) 718documentStates ?? DocumentStates, 783=> DocumentStates.UpdateStates(static (state, checksumAlgorithm) => state.UpdateChecksumAlgorithm(checksumAlgorithm), checksumAlgorithm); 820documentStates: DocumentStates.UpdateStates(static (state, args) => 889Debug.Assert(!documents.Any(d => DocumentStates.Contains(d.Id))); 893documentStates: DocumentStates.AddRange(documents)); 948documentStates: DocumentStates.RemoveRange(documentIds), 974if (DocumentStates.IsEmpty) 986=> UpdateDocuments([DocumentStates.GetRequiredState(newDocument.Id)], [newDocument]); 994var newDocumentStates = DocumentStates.SetStates(newDocuments); 1023DocumentStates, 1048if (documentIds.SequenceEqual(DocumentStates.Ids)) 1055documentStates: DocumentStates.WithCompilationOrder(documentIds)); 1133this.DocumentStates.AddDocumentIdsWithFilePath(ref temporaryArray, filePath); 1140return this.DocumentStates.GetFirstDocumentIdWithFilePath(filePath) ??
Workspace\Solution\ProjectState_Checksum.cs (1)
47var documentChecksumsTask = DocumentStates.GetDocumentChecksumsAndIdsAsync(cancellationToken);
Workspace\Solution\SolutionCompilationState.cs (5)
916var oldDocumentStates = newDocumentStates.SelectAsArray(static (s, oldProjectState) => oldProjectState.DocumentStates.GetRequiredState(s.Id), oldProjectState); 1102var oldDocument = stateChange.OldProjectState.DocumentStates.GetRequiredState(documentId); 1103var newDocument = stateChange.NewProjectState.DocumentStates.GetRequiredState(documentId); 1731var oldDocumentState = oldProjectState.DocumentStates.GetState(documentId); 1894var documentState = this.SolutionState.GetProjectState(documentId.ProjectId)?.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (4)
34state => string.Join(",", state.AssemblyName, state.DocumentStates.Count); 327foreach (var chunk in this.ProjectState.DocumentStates.GetStatesInCompilationOrder().Chunk(TranslationAction.AddDocumentsAction.AddDocumentsBatchSize)) 777foreach (var documentState in this.ProjectState.DocumentStates.GetStatesInCompilationOrder()) 969foreach (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\SolutionCompilationState.TranslationAction_Actions.cs (2)
209using var _ = ArrayBuilder<SyntaxTree>.GetInstance(this.NewProjectState.DocumentStates.Count, out var syntaxTrees); 210foreach (var documentState in this.NewProjectState.DocumentStates.GetStatesInCompilationOrder())
Workspace\Solution\SolutionState.cs (7)
287this.GetProjectState(documentId.ProjectId)!.DocumentStates.Contains(documentId); 313=> GetRequiredProjectState(documentId.ProjectId).DocumentStates.GetRequiredState(documentId); 836if (documentIds.Count != oldProject.DocumentStates.Count) 843if (!oldProject.DocumentStates.Contains(id)) 1270var documentState = projectState.DocumentStates.GetState(documentId); 1325var documentState = projectState.DocumentStates.GetState(documentId); 1359return projectState.DocumentStates.Contains(documentId);
Workspace\Solution\StateChecksums.cs (1)
475await ChecksumCollection.FindAsync(assetPath, state.DocumentStates, searchingChecksumsLeft, onAssetFound, arg, cancellationToken).ConfigureAwait(false);
Workspace\Workspace.cs (2)
1787var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ?? 1788projectChanges.NewProject.State.DocumentStates.GetState(documentId)!;