1 type derived from DocumentState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
14
internal sealed class SourceGeneratedDocumentState :
DocumentState
5 instantiations of DocumentState
Microsoft.CodeAnalysis.Workspaces (5)
Workspace\Solution\DocumentState.cs (5)
83
return new
DocumentState
(
423
return new
DocumentState
(
434
=> new
DocumentState
(
478
return new
DocumentState
(
521
return new
DocumentState
(
124 references to DocumentState
Microsoft.CodeAnalysis.Workspaces (124)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
63
sourceGeneratorDocumentStates.States.Select(kvp => (kvp.Key, (
DocumentState
)kvp.Value)));
FindSymbols\Shared\AbstractSyntaxIndex.cs (6)
21
private static readonly ConditionalWeakTable<
DocumentState
, TIndex?> s_documentToIndex = new();
30
SolutionKey solutionKey, ProjectState project,
DocumentState
document, IndexReader read, IndexCreator create, CancellationToken cancellationToken)
37
protected static ValueTask<TIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, IndexReader read, IndexCreator create, CancellationToken cancellationToken)
44
DocumentState
document,
82
DocumentState
document,
116
DocumentState
document,
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (5)
40
DocumentState
document,
94
DocumentState
document,
136
DocumentState
document,
149
(
DocumentState
)document.State,
157
DocumentState
document,
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (6)
39
=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (
DocumentState
)document.State, cancellationToken);
41
public static ValueTask<SyntaxTreeIndex> GetRequiredIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, CancellationToken cancellationToken)
45
=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (
DocumentState
)document.State, cancellationToken);
47
public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, CancellationToken cancellationToken)
51
=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (
DocumentState
)document.State, loadOnly, cancellationToken);
53
public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, bool loadOnly, CancellationToken cancellationToken)
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (6)
47
=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (
DocumentState
)document.State, cancellationToken);
49
public static ValueTask<TopLevelSyntaxTreeIndex> GetRequiredIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, CancellationToken cancellationToken)
53
=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (
DocumentState
)document.State, cancellationToken);
55
public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, CancellationToken cancellationToken)
59
=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (
DocumentState
)document.State, loadOnly, cancellationToken);
61
public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project,
DocumentState
document, bool loadOnly, CancellationToken cancellationToken)
Workspace\Solution\Document.cs (3)
46
internal Document(Project project,
DocumentState
state)
51
internal
DocumentState
DocumentState => (
DocumentState
)State;
Workspace\Solution\DocumentState.cs (15)
56
public static
DocumentState
Create(
295
public bool HasContentChanged(
DocumentState
oldState)
302
public bool HasTextChanged(
DocumentState
oldState)
305
public
DocumentState
UpdateChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm)
339
public
DocumentState
UpdateParseOptionsAndSourceCodeKind(ParseOptions options, bool onlyPreprocessorDirectiveChange)
386
public
DocumentState
UpdateSourceCodeKind(SourceCodeKind kind)
443
public new
DocumentState
WithAttributes(DocumentInfo.DocumentAttributes newAttributes)
444
=> (
DocumentState
)base.WithAttributes(newAttributes);
446
public new
DocumentState
UpdateText(SourceText newText, PreservationMode mode)
447
=> (
DocumentState
)base.UpdateText(newText, mode);
449
public new
DocumentState
UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode)
450
=> (
DocumentState
)base.UpdateText(newTextAndVersion, mode);
452
public new
DocumentState
UpdateText(TextLoader loader, PreservationMode mode)
453
=> (
DocumentState
)base.UpdateText(loader, mode);
488
internal
DocumentState
UpdateTree(SyntaxNode newRoot, PreservationMode mode)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (2)
61
public
DocumentState
UpdateTextAndTreeContents(
100
private static
DocumentState
UpdateTextAndTreeContentsWorker(
Workspace\Solution\Project.cs (1)
466
(documentId, project) => project.State.DocumentStates.TryGetState(documentId, out
var
state) ? new Document(project, state) : null;
Workspace\Solution\ProjectState.cs (27)
35
public readonly TextDocumentStates<
DocumentState
> DocumentStates;
71
TextDocumentStates<
DocumentState
> documentStates,
120
DocumentStates = new TextDocumentStates<
DocumentState
>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions));
139
typeof(TDocumentState) == typeof(
DocumentState
) ? DocumentStates :
198
private static async Task<VersionStamp> ComputeLatestDocumentVersionAsync(TextDocumentStates<
DocumentState
> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken)
226
TextDocumentStates<
DocumentState
> newDocumentStates,
256
private static async Task<VersionStamp> ComputeLatestDocumentTopLevelChangeVersionAsync(TextDocumentStates<
DocumentState
> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken)
279
internal
DocumentState
CreateDocument(DocumentInfo documentInfo, ParseOptions? parseOptions, LoadTextOptions loadTextOptions)
281
var
doc =
DocumentState
.Create(LanguageServices, documentInfo, parseOptions, loadTextOptions);
294
typeof(TDocumentState) == typeof(
DocumentState
) ? CreateDocument(documentInfo, ParseOptions, new LoadTextOptions(ChecksumAlgorithm)) :
372
var documentId =
DocumentState
.GetDocumentIdForTree(tree);
382
internal async ValueTask<StructuredAnalyzerConfigOptions> GetOptionsAsync(
DocumentState
documentState, CancellationToken cancellationToken)
388
private StructuredAnalyzerConfigOptions GetOptions(in AnalyzerConfigOptionsCache.Value cache,
DocumentState
documentState)
405
private string? GetEffectiveFilePath(
DocumentState
documentState)
444
var documentId =
DocumentState
.GetDocumentIdForTree(tree);
454
internal async ValueTask<StructuredAnalyzerConfigOptions> GetOptionsAsync(
DocumentState
documentState, CancellationToken cancellationToken)
460
private StructuredAnalyzerConfigOptions GetOptions(in AnalyzerConfigOptionsCache.Value cache,
DocumentState
documentState)
484
private string? GetEffectiveFilePath(
DocumentState
documentState)
683
TextDocumentStates<
DocumentState
>? documentStates = null,
757
private TextDocumentStates<
DocumentState
> UpdateDocumentsChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm)
859
public ProjectState AddDocuments(ImmutableArray<
DocumentState
> documents)
956
documentStates: TextDocumentStates<
DocumentState
>.Empty,
960
public ProjectState UpdateDocument(
DocumentState
newDocument)
963
public ProjectState UpdateDocuments(ImmutableArray<
DocumentState
> oldDocuments, ImmutableArray<
DocumentState
> newDocuments)
1034
TextDocumentStates<
DocumentState
> newDocumentStates,
Workspace\Solution\Solution.cs (6)
320
var
documentState = CompilationState.GetDocumentState(syntaxTree, projectId);
331
else if (documentState is
DocumentState
)
1032
=> WithCompilationState(CompilationState.AddDocumentsToMultipleProjects<
DocumentState
>(documentInfos));
1143
=> WithCompilationState(CompilationState.RemoveDocumentsFromMultipleProjects<
DocumentState
>(documentIds));
1386
internal Solution WithDocumentContentsFrom(DocumentId documentId,
DocumentState
documentState, bool forceEvenIfTreesWouldDiffer)
1389
internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId,
DocumentState
documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer)
Workspace\Solution\SolutionCompilationState.cs (19)
37
/// green <see cref="
DocumentState
"/>s. Contains the attributes, options and relationships between projects.
607
UpdateDocuments<
DocumentState
>(info.Documents);
782
=> UpdateDocumentsInMultipleProjects<
DocumentState
, SourceText, PreservationMode>(
788
private static bool SourceTextIsUnchanged(
DocumentState
oldDocument, SourceText text)
871
ImmutableArray<
DocumentState
> ordinaryNewDocumentStates => GetUpdateOrdinaryDocumentsTranslationAction(oldProjectState, ordinaryNewDocumentStates),
877
TranslationAction GetUpdateOrdinaryDocumentsTranslationAction(ProjectState oldProjectState, ImmutableArray<
DocumentState
> newDocumentStates)
900
DocumentState
documentState)
952
return UpdateDocumentsInMultipleProjects<
DocumentState
, SyntaxNode, PreservationMode>(
962
ImmutableArray<(DocumentId documentId,
DocumentState
documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer)
964
return UpdateDocumentsInMultipleProjects<
DocumentState
,
DocumentState
, bool>(
1571
using var _ = ArrayBuilder<
DocumentState
>.GetInstance(allDocumentIds.Length, out var documentStates);
1579
var
documentState = @this.SolutionState.GetRequiredDocumentState(currentDocumentId);
1596
ArrayBuilder<
DocumentState
> documentStates,
1601
using var _ = PooledDictionary<ProjectId, ArrayBuilder<
DocumentState
>>.GetInstance(out var missingDocumentStates);
1604
foreach (
var
newDocumentState in documentStates)
1608
var
oldDocumentState = oldProjectState.DocumentStates.GetState(documentId);
1712
ImmutableArray<
DocumentState
> documentStates => new TranslationAction.RemoveDocumentsAction(oldProject, oldProject.RemoveDocuments(documentIds), documentStates),
1721
ImmutableArray<
DocumentState
> documentStates => new TranslationAction.AddDocumentsAction(oldProject, oldProject.AddDocuments(documentStates), documentStates),
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
765
using var _1 = ArrayBuilder<
DocumentState
>.GetInstance(out var documentsWithTreesBuilder);
767
foreach (
var
documentState in this.ProjectState.DocumentStates.GetStatesInCompilationOrder())
785
foreach (
var
documentState in documentsWithTrees)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (3)
15
internal
DocumentState
? GetDocumentState(SyntaxTree? syntaxTree, ProjectId? projectId)
20
var documentId =
DocumentState
.GetDocumentIdForTree(syntaxTree);
27
var
document = projectState.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (6)
24
ImmutableArray<
DocumentState
> oldStates,
25
ImmutableArray<
DocumentState
> newStates) : TranslationAction(oldProjectState, newProjectState)
27
private readonly ImmutableArray<
DocumentState
> _oldStates = oldStates;
28
private readonly ImmutableArray<
DocumentState
> _newStates = newStates;
36
var
newState = _newStates[i];
37
var
oldState = _oldStates[i];
Workspace\Solution\SolutionState.cs (12)
301
internal
DocumentState
GetRequiredDocumentState(DocumentId documentId)
935
var
oldDocument = GetRequiredDocumentState(documentId);
937
var
newDocument = oldDocument.WithAttributes(updateAttributes(oldDocument.Attributes, arg));
953
var
oldDocument = GetRequiredDocumentState(documentId);
963
public StateChange WithDocumentState(
DocumentState
newDocument)
965
var
oldDocument = GetRequiredDocumentState(newDocument.Id);
1013
var
oldDocument = GetRequiredDocumentState(documentId);
1061
var
oldDocument = GetRequiredDocumentState(documentId);
1073
var
oldDocument = GetRequiredDocumentState(documentId);
1106
private StateChange UpdateDocumentState(
DocumentState
newDocument)
1245
var
documentState = projectState.DocumentStates.GetState(documentId);
1299
var
documentState = projectState.DocumentStates.GetState(documentId);
Workspace\Workspace.cs (3)
323
using var _ = ArrayBuilder<(DocumentId,
DocumentState
)>.GetInstance(out var relatedDocumentIdsAndStates);
364
using var _ = PooledDictionary<DocumentId,
DocumentState
>.GetInstance(out var relatedDocumentIdsAndStates);
1717
var
document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ??