2 writes to DocumentStates
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\ProjectState.cs (2)
78
DocumentStates
= documentStates;
116
DocumentStates
= new TextDocumentStates<DocumentState>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions));
57 references to DocumentStates
Microsoft.CodeAnalysis.Workspaces (57)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
79
var regularDocumentStates = project.State.
DocumentStates
;
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
94
var textChecksumsTasks = projectState.
DocumentStates
.States.Values.OrderBy(state => state.FilePath, StringComparer.Ordinal).Select(async state =>
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
324
foreach (var (_, documentState) in projectState.
DocumentStates
.States)
Workspace\Solution\Project.cs (4)
177
public bool HasDocuments => !State.
DocumentStates
.IsEmpty;
182
public 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);
132
typeof(TDocumentState) == typeof(DocumentState) ?
DocumentStates
:
140
foreach (var (documentId, documentState) in this.
DocumentStates
.States)
399
if (documentId != null && projectState.
DocumentStates
.TryGetState(documentId, out var documentState))
471
if (documentId != null && projectState.
DocumentStates
.TryGetState(documentId, out var documentState))
718
documentStates ??
DocumentStates
,
783
=>
DocumentStates
.UpdateStates(static (state, checksumAlgorithm) => state.UpdateChecksumAlgorithm(checksumAlgorithm), checksumAlgorithm);
820
documentStates:
DocumentStates
.UpdateStates(static (state, args) =>
889
Debug.Assert(!documents.Any(d =>
DocumentStates
.Contains(d.Id)));
893
documentStates:
DocumentStates
.AddRange(documents));
948
documentStates:
DocumentStates
.RemoveRange(documentIds),
974
if (
DocumentStates
.IsEmpty)
986
=> UpdateDocuments([
DocumentStates
.GetRequiredState(newDocument.Id)], [newDocument]);
994
var newDocumentStates =
DocumentStates
.SetStates(newDocuments);
1023
DocumentStates
,
1048
if (documentIds.SequenceEqual(
DocumentStates
.Ids))
1055
documentStates:
DocumentStates
.WithCompilationOrder(documentIds));
1133
this.
DocumentStates
.AddDocumentIdsWithFilePath(ref temporaryArray, filePath);
1140
return this.
DocumentStates
.GetFirstDocumentIdWithFilePath(filePath) ??
Workspace\Solution\ProjectState_Checksum.cs (1)
47
var documentChecksumsTask =
DocumentStates
.GetDocumentChecksumsAndIdsAsync(cancellationToken);
Workspace\Solution\SolutionCompilationState.cs (5)
916
var oldDocumentStates = newDocumentStates.SelectAsArray(static (s, oldProjectState) => oldProjectState.
DocumentStates
.GetRequiredState(s.Id), oldProjectState);
1102
var oldDocument = stateChange.OldProjectState.
DocumentStates
.GetRequiredState(documentId);
1103
var newDocument = stateChange.NewProjectState.
DocumentStates
.GetRequiredState(documentId);
1731
var oldDocumentState = oldProjectState.
DocumentStates
.GetState(documentId);
1894
var documentState = this.SolutionState.GetProjectState(documentId.ProjectId)?.
DocumentStates
.GetState(documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (4)
34
state => string.Join(",", state.AssemblyName, state.
DocumentStates
.Count);
327
foreach (var chunk in this.ProjectState.
DocumentStates
.GetStatesInCompilationOrder().Chunk(TranslationAction.AddDocumentsAction.AddDocumentsBatchSize))
777
foreach (var documentState in this.ProjectState.
DocumentStates
.GetStatesInCompilationOrder())
969
foreach (var documentInProjectState in projectState.
DocumentStates
.States)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
255
foreach (var documentState in ProjectState.
DocumentStates
.States)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
27
var document = projectState.
DocumentStates
.GetState(documentId);
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (2)
209
using var _ = ArrayBuilder<SyntaxTree>.GetInstance(this.NewProjectState.
DocumentStates
.Count, out var syntaxTrees);
210
foreach (var documentState in this.NewProjectState.
DocumentStates
.GetStatesInCompilationOrder())
Workspace\Solution\SolutionState.cs (7)
287
this.GetProjectState(documentId.ProjectId)!.
DocumentStates
.Contains(documentId);
313
=> GetRequiredProjectState(documentId.ProjectId).
DocumentStates
.GetRequiredState(documentId);
836
if (documentIds.Count != oldProject.
DocumentStates
.Count)
843
if (!oldProject.
DocumentStates
.Contains(id))
1270
var documentState = projectState.
DocumentStates
.GetState(documentId);
1325
var documentState = projectState.
DocumentStates
.GetState(documentId);
1359
return projectState.
DocumentStates
.Contains(documentId);
Workspace\Solution\StateChecksums.cs (1)
475
await ChecksumCollection.FindAsync(assetPath, state.
DocumentStates
, searchingChecksumsLeft, onAssetFound, arg, cancellationToken).ConfigureAwait(false);
Workspace\Workspace.cs (2)
1787
var document = projectChanges.OldProject.State.
DocumentStates
.GetState(documentId) ??
1788
projectChanges.NewProject.State.
DocumentStates
.GetState(documentId)!;