1 type derived from DocumentState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
14internal sealed class SourceGeneratedDocumentState : DocumentState
5 instantiations of DocumentState
Microsoft.CodeAnalysis.Workspaces (5)
Workspace\Solution\DocumentState.cs (5)
83return new DocumentState( 423return new DocumentState( 434=> new DocumentState( 478return new DocumentState( 506return new DocumentState(
124 references to DocumentState
Microsoft.CodeAnalysis.Workspaces (124)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
63sourceGeneratorDocumentStates.States.Select(kvp => (kvp.Key, (DocumentState)kvp.Value)));
FindSymbols\Shared\AbstractSyntaxIndex.cs (6)
21private static readonly ConditionalWeakTable<DocumentState, TIndex?> s_documentToIndex = new(); 30SolutionKey solutionKey, ProjectState project, DocumentState document, IndexReader read, IndexCreator create, CancellationToken cancellationToken) 37protected static ValueTask<TIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, IndexReader read, IndexCreator create, CancellationToken cancellationToken) 44DocumentState document, 82DocumentState document, 116DocumentState document,
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (5)
40DocumentState document, 94DocumentState document, 136DocumentState document, 149(DocumentState)document.State, 157DocumentState document,
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (6)
39=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 41public 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); 47public 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); 53public 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); 49public 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); 55public 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); 61public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, bool loadOnly, CancellationToken cancellationToken)
Workspace\Solution\Document.cs (3)
46internal Document(Project project, DocumentState state) 51internal DocumentState DocumentState => (DocumentState)State;
Workspace\Solution\DocumentState.cs (15)
56public static DocumentState Create( 295public bool HasContentChanged(DocumentState oldState) 302public bool HasTextChanged(DocumentState oldState) 305public DocumentState UpdateChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm) 339public DocumentState UpdateParseOptionsAndSourceCodeKind(ParseOptions options, bool onlyPreprocessorDirectiveChange) 386public DocumentState UpdateSourceCodeKind(SourceCodeKind kind) 443public new DocumentState WithAttributes(DocumentInfo.DocumentAttributes newAttributes) 444=> (DocumentState)base.WithAttributes(newAttributes); 446public new DocumentState UpdateText(SourceText newText, PreservationMode mode) 447=> (DocumentState)base.UpdateText(newText, mode); 449public new DocumentState UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode) 450=> (DocumentState)base.UpdateText(newTextAndVersion, mode); 452public new DocumentState UpdateText(TextLoader loader, PreservationMode mode) 453=> (DocumentState)base.UpdateText(loader, mode); 488internal DocumentState UpdateTree(SyntaxNode newRoot, PreservationMode mode)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (2)
61public DocumentState UpdateTextAndTreeContents( 100private 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)
33public readonly TextDocumentStates<DocumentState> DocumentStates; 70TextDocumentStates<DocumentState> documentStates, 116DocumentStates = new TextDocumentStates<DocumentState>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions)); 132typeof(TDocumentState) == typeof(DocumentState) ? DocumentStates : 223private static async Task<VersionStamp> ComputeLatestDocumentVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 251TextDocumentStates<DocumentState> newDocumentStates, 281private static async Task<VersionStamp> ComputeLatestDocumentTopLevelChangeVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 304internal DocumentState CreateDocument(DocumentInfo documentInfo, ParseOptions? parseOptions, LoadTextOptions loadTextOptions) 306var doc = DocumentState.Create(LanguageServices, documentInfo, parseOptions, loadTextOptions); 319typeof(TDocumentState) == typeof(DocumentState) ? CreateDocument(documentInfo, ParseOptions, new LoadTextOptions(ChecksumAlgorithm)) : 397var documentId = DocumentState.GetDocumentIdForTree(tree); 407internal async ValueTask<StructuredAnalyzerConfigOptions> GetOptionsAsync(DocumentState documentState, CancellationToken cancellationToken) 413private StructuredAnalyzerConfigOptions GetOptions(in AnalyzerConfigOptionsCache.Value cache, DocumentState documentState) 430private string? GetEffectiveFilePath(DocumentState documentState) 469var documentId = DocumentState.GetDocumentIdForTree(tree); 479internal async ValueTask<StructuredAnalyzerConfigOptions> GetOptionsAsync(DocumentState documentState, CancellationToken cancellationToken) 485private StructuredAnalyzerConfigOptions GetOptions(in AnalyzerConfigOptionsCache.Value cache, DocumentState documentState) 509private string? GetEffectiveFilePath(DocumentState documentState) 708TextDocumentStates<DocumentState>? documentStates = null, 782private TextDocumentStates<DocumentState> UpdateDocumentsChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm) 884public ProjectState AddDocuments(ImmutableArray<DocumentState> documents) 981documentStates: TextDocumentStates<DocumentState>.Empty, 985public ProjectState UpdateDocument(DocumentState newDocument) 988public ProjectState UpdateDocuments(ImmutableArray<DocumentState> oldDocuments, ImmutableArray<DocumentState> newDocuments) 1059TextDocumentStates<DocumentState> newDocumentStates,
Workspace\Solution\Solution.cs (6)
320var documentState = CompilationState.GetDocumentState(syntaxTree, projectId); 331else if (documentState is DocumentState) 1032=> WithCompilationState(CompilationState.AddDocumentsToMultipleProjects<DocumentState>(documentInfos)); 1143=> WithCompilationState(CompilationState.RemoveDocumentsFromMultipleProjects<DocumentState>(documentIds)); 1386internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer) 1389internal 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. 607UpdateDocuments<DocumentState>(info.Documents); 782=> UpdateDocumentsInMultipleProjects<DocumentState, SourceText, PreservationMode>( 788private static bool SourceTextIsUnchanged(DocumentState oldDocument, SourceText text) 871ImmutableArray<DocumentState> ordinaryNewDocumentStates => GetUpdateOrdinaryDocumentsTranslationAction(oldProjectState, ordinaryNewDocumentStates), 877TranslationAction GetUpdateOrdinaryDocumentsTranslationAction(ProjectState oldProjectState, ImmutableArray<DocumentState> newDocumentStates) 900DocumentState documentState) 952return UpdateDocumentsInMultipleProjects<DocumentState, SyntaxNode, PreservationMode>( 962ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 964return UpdateDocumentsInMultipleProjects<DocumentState, DocumentState, bool>( 1594using var _ = ArrayBuilder<DocumentState>.GetInstance(allDocumentIds.Length, out var documentStates); 1602var documentState = @this.SolutionState.GetRequiredDocumentState(currentDocumentId); 1619ArrayBuilder<DocumentState> documentStates, 1624using var _ = PooledDictionary<ProjectId, ArrayBuilder<DocumentState>>.GetInstance(out var missingDocumentStates); 1627foreach (var newDocumentState in documentStates) 1631var oldDocumentState = oldProjectState.DocumentStates.GetState(documentId); 1735ImmutableArray<DocumentState> documentStates => new TranslationAction.RemoveDocumentsAction(oldProject, oldProject.RemoveDocuments(documentIds), documentStates), 1744ImmutableArray<DocumentState> documentStates => new TranslationAction.AddDocumentsAction(oldProject, oldProject.AddDocuments(documentStates), documentStates),
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
765using var _1 = ArrayBuilder<DocumentState>.GetInstance(out var documentsWithTreesBuilder); 767foreach (var documentState in this.ProjectState.DocumentStates.GetStatesInCompilationOrder()) 785foreach (var documentState in documentsWithTrees)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (3)
15internal DocumentState? GetDocumentState(SyntaxTree? syntaxTree, ProjectId? projectId) 20var documentId = DocumentState.GetDocumentIdForTree(syntaxTree); 27var document = projectState.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (6)
24ImmutableArray<DocumentState> oldStates, 25ImmutableArray<DocumentState> newStates) : TranslationAction(oldProjectState, newProjectState) 27private readonly ImmutableArray<DocumentState> _oldStates = oldStates; 28private readonly ImmutableArray<DocumentState> _newStates = newStates; 36var newState = _newStates[i]; 37var oldState = _oldStates[i];
Workspace\Solution\SolutionState.cs (12)
301internal DocumentState GetRequiredDocumentState(DocumentId documentId) 935var oldDocument = GetRequiredDocumentState(documentId); 937var newDocument = oldDocument.WithAttributes(updateAttributes(oldDocument.Attributes, arg)); 953var oldDocument = GetRequiredDocumentState(documentId); 963public StateChange WithDocumentState(DocumentState newDocument) 965var oldDocument = GetRequiredDocumentState(newDocument.Id); 1013var oldDocument = GetRequiredDocumentState(documentId); 1061var oldDocument = GetRequiredDocumentState(documentId); 1073var oldDocument = GetRequiredDocumentState(documentId); 1106private StateChange UpdateDocumentState(DocumentState newDocument) 1245var documentState = projectState.DocumentStates.GetState(documentId); 1299var documentState = projectState.DocumentStates.GetState(documentId);
Workspace\Workspace.cs (3)
333using var _ = ArrayBuilder<(DocumentId, DocumentState)>.GetInstance(out var relatedDocumentIdsAndStates); 374using var _ = PooledDictionary<DocumentId, DocumentState>.GetInstance(out var relatedDocumentIdsAndStates); 1759var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ??