2 writes to DocumentStates
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\ProjectState.cs (2)
67
DocumentStates
= documentStates;
105
DocumentStates
= new TextDocumentStates<DocumentState>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions));
76 references to DocumentStates
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
227
.
DocumentStates
.GetState(document1.Id)
234
.
DocumentStates
.GetState(document2.Id)
Microsoft.CodeAnalysis.Features (15)
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
245
var filePath = project.State.
DocumentStates
.GetRequiredState(documentId).FilePath;
EditAndContinue\EditAndContinueService.cs (2)
152
? solution.Projects.Select(project => (project, project.State.
DocumentStates
.States.Values))
188
select (project, from documentId in projectDocumentIds select project.State.
DocumentStates
.GetState(documentId));
EditAndContinue\EditSession.cs (10)
347
foreach (var documentId in newProject.State.
DocumentStates
.GetChangedStateIds(oldProject.State.
DocumentStates
, ignoreUnchangedContent: true))
368
foreach (var documentId in newProject.State.
DocumentStates
.GetAddedStateIds(oldProject.State.
DocumentStates
))
384
foreach (var documentId in newProject.State.
DocumentStates
.GetRemovedStateIds(oldProject.State.
DocumentStates
))
515
foreach (var documentId in newProject.State.
DocumentStates
.GetChangedStateIds(oldProject.State.
DocumentStates
, ignoreUnchangedContent: true))
528
if (!newProject.State.
DocumentStates
.HasAnyStateChanges(oldProject.State.
DocumentStates
) &&
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
603
count += projectState.
DocumentStates
.Count;
Workspace\CompileTimeSolutionProvider.cs (1)
119
foreach (var (_, documentState) in projectState.
DocumentStates
.States)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\SolutionAssetCache.cs (1)
187
AddAll(projectState.
DocumentStates
);
Microsoft.CodeAnalysis.Workspaces (58)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
79
var regularDocumentStates = project.State.
DocumentStates
;
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
95
var textChecksumsTasks = projectState.
DocumentStates
.States.Values.OrderBy(state => state.FilePath, StringComparer.Ordinal).Select(async state =>
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
311
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);
497
(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)
108
_lazyLatestDocumentVersion = AsyncLazy.Create(static async (self, c) => await ComputeLatestDocumentVersionAsync(self.
DocumentStates
, self.AdditionalDocumentStates, c).ConfigureAwait(false), arg: this);
109
_lazyLatestDocumentTopLevelChangeVersion = AsyncLazy.Create(static (self, c) => ComputeLatestDocumentTopLevelChangeVersionAsync(self.
DocumentStates
, self.AdditionalDocumentStates, c), arg: this);
121
typeof(TDocumentState) == typeof(DocumentState) ?
DocumentStates
:
129
foreach (var (documentId, documentState) in this.
DocumentStates
.States)
391
if (documentId != null && projectState.
DocumentStates
.TryGetState(documentId, out var documentState))
463
if (documentId != null && projectState.
DocumentStates
.TryGetState(documentId, out var documentState))
710
documentStates ??
DocumentStates
,
775
=>
DocumentStates
.UpdateStates(static (state, checksumAlgorithm) => state.UpdateChecksumAlgorithm(checksumAlgorithm), checksumAlgorithm);
812
documentStates:
DocumentStates
.UpdateStates(static (state, args) =>
881
Debug.Assert(!documents.Any(d =>
DocumentStates
.Contains(d.Id)));
885
documentStates:
DocumentStates
.AddRange(documents));
940
documentStates:
DocumentStates
.RemoveRange(documentIds),
966
if (
DocumentStates
.IsEmpty)
978
=> UpdateDocuments([
DocumentStates
.GetRequiredState(newDocument.Id)], [newDocument]);
986
var newDocumentStates =
DocumentStates
.SetStates(newDocuments);
1015
DocumentStates
,
1040
if (documentIds.SequenceEqual(
DocumentStates
.Ids))
1047
documentStates:
DocumentStates
.WithCompilationOrder(documentIds));
1125
this.
DocumentStates
.AddDocumentIdsWithFilePath(ref temporaryArray, filePath);
1132
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 (5)
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())
965
capacity: projectState.
DocumentStates
.Count + generatorInfo?.Documents.Count ?? 0
969
foreach (var documentInProjectState in projectState.
DocumentStates
.States)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
257
foreach (var documentState in ProjectState.
DocumentStates
.States)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
28
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)
473
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)!;