1 type derived from DocumentState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
12internal sealed class SourceGeneratedDocumentState : DocumentState
9 instantiations of DocumentState
Microsoft.CodeAnalysis.Workspaces (9)
Workspace\Solution\DocumentState.cs (6)
314return new DocumentState( 382return new DocumentState( 414return new DocumentState( 439return new DocumentState( 481return new DocumentState( 524return new DocumentState(
Workspace\Solution\DocumentState_LinkedFileReuse.cs (2)
26return new DocumentState( 58return new DocumentState(
Workspace\Solution\ProjectState.cs (1)
237var doc = new DocumentState(LanguageServices, documentInfo, parseOptions, loadTextOptions);
104 references to DocumentState
IdeCoreBenchmarks (10)
NavigateToBenchmarks.cs (10)
132Console.WriteLine($"{nameof(DocumentState.TestAccessor.TryReuseSyntaxTree)} - {DocumentState.TestAccessor.TryReuseSyntaxTree}"); 133Console.WriteLine($"{nameof(DocumentState.TestAccessor.CouldReuseBecauseOfEqualPPNames)} - {DocumentState.TestAccessor.CouldReuseBecauseOfEqualPPNames}"); 134Console.WriteLine($"{nameof(DocumentState.TestAccessor.CouldReuseBecauseOfNoDirectives)} - {DocumentState.TestAccessor.CouldReuseBecauseOfNoDirectives}"); 135Console.WriteLine($"{nameof(DocumentState.TestAccessor.CouldReuseBecauseOfNoPPDirectives)} - {DocumentState.TestAccessor.CouldReuseBecauseOfNoPPDirectives}"); 136Console.WriteLine($"{nameof(DocumentState.TestAccessor.CouldNotReuse)} - {DocumentState.TestAccessor.CouldNotReuse}");
Microsoft.CodeAnalysis.EditorFeatures (3)
EditAndContinue\PdbMatchingSourceTextProvider.cs (3)
30private readonly Dictionary<string, (DocumentState state, int solutionVersion)> _documentsWithChangedLoaderByPath = new(); 129DocumentState? state; 164public ImmutableDictionary<string, (DocumentState state, int solutionVersion)> GetDocumentsWithChangedLoaderByPath()
Microsoft.CodeAnalysis.Features (4)
EditAndContinue\CommittedSolution.cs (1)
349IEnumerable<(Project, IEnumerable<CodeAnalysis.DocumentState>)> documentsByProject,
EditAndContinue\EditAndContinueWorkspaceService.cs (1)
162private static IEnumerable<(Project, IEnumerable<DocumentState>)> GetDocumentStatesGroupedByProject(Solution solution, ImmutableArray<DocumentId> documentIds)
EditAndContinue\Extensions.cs (1)
97if (textDocumentState is DocumentState documentState)
Workspace\CompileTimeSolutionProvider.cs (1)
163private static bool IsRazorDesignTimeDocument(DocumentState documentState)
Microsoft.CodeAnalysis.Workspaces (87)
Workspace\Solution\Document.cs (3)
41internal Document(Project project, DocumentState state) 46internal DocumentState DocumentState => (DocumentState)State;
Workspace\Solution\DocumentState.cs (18)
280public bool HasContentChanged(DocumentState oldState) 287public bool HasTextChanged(DocumentState oldState) 290public DocumentState UpdateChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm) 324public DocumentState UpdateParseOptions(ParseOptions options, bool onlyPreprocessorDirectiveChange) 328var newState = this.SetParseOptions(options, onlyPreprocessorDirectiveChange); 337private DocumentState SetParseOptions(ParseOptions options, bool onlyPreprocessorDirectiveChange) 392public DocumentState UpdateSourceCodeKind(SourceCodeKind kind) 404public DocumentState UpdateName(string name) 407public DocumentState UpdateFolders(IReadOnlyList<string> folders) 410private DocumentState UpdateAttributes(DocumentInfo.DocumentAttributes attributes) 424public DocumentState UpdateFilePath(string? filePath) 449public new DocumentState UpdateText(SourceText newText, PreservationMode mode) 450=> (DocumentState)base.UpdateText(newText, mode); 452public new DocumentState UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode) 453=> (DocumentState)base.UpdateText(newTextAndVersion, mode); 455public new DocumentState UpdateText(TextLoader loader, PreservationMode mode) 456=> (DocumentState)base.UpdateText(loader, mode); 491internal DocumentState UpdateTree(SyntaxNode newRoot, PreservationMode mode)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
22public DocumentState UpdateTextAndTreeContents(ITextAndVersionSource siblingTextSource, ValueSource<TreeAndVersion>? siblingTreeSource)
Workspace\Solution\Project.cs (1)
447(documentId, project) => project._projectState.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null;
Workspace\Solution\ProjectState.cs (20)
36public readonly TextDocumentStates<DocumentState> DocumentStates; 71TextDocumentStates<DocumentState> documentStates, 119DocumentStates = new TextDocumentStates<DocumentState>(projectInfoFixed.Documents, info => CreateDocument(info, parseOptions, loadTextOptions)); 165private static async Task<VersionStamp> ComputeLatestDocumentVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 193TextDocumentStates<DocumentState> newDocumentStates, 212private static async Task<VersionStamp> ComputeLatestDocumentTopLevelChangeVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 235internal DocumentState CreateDocument(DocumentInfo documentInfo, ParseOptions? parseOptions, LoadTextOptions loadTextOptions) 237var doc = new DocumentState(LanguageServices, documentInfo, parseOptions, loadTextOptions); 310var documentId = DocumentState.GetDocumentIdForTree(tree); 312if (documentId != null && _projectState.DocumentStates.TryGetState(documentId, out var documentState)) 320internal async ValueTask<StructuredAnalyzerConfigOptions> GetOptionsAsync(DocumentState documentState, CancellationToken cancellationToken) 326private StructuredAnalyzerConfigOptions GetOptions(in AnalyzerConfigOptionsCache cache, DocumentState documentState) 359private string? GetEffectiveFilePath(DocumentState documentState) 603TextDocumentStates<DocumentState>? documentStates = null, 674private TextDocumentStates<DocumentState> UpdateDocumentsChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm) 786public ProjectState AddDocuments(ImmutableArray<DocumentState> documents) 862documentStates: TextDocumentStates<DocumentState>.Empty, 866public ProjectState UpdateDocument(DocumentState newDocument, bool contentChanged) 868var oldDocument = DocumentStates.GetRequiredState(newDocument.Id); 930TextDocumentStates<DocumentState> newDocumentStates,
Workspace\Solution\Solution.cs (3)
288var documentState = State.GetDocumentState(syntaxTree, projectId); 299else if (documentState is DocumentState) 1555internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState)
Workspace\Solution\SolutionState.CompilationAndGeneratorDriverTranslationAction_Actions.cs (11)
23private readonly DocumentState _oldState; 24private readonly DocumentState _newState; 26public TouchDocumentAction(DocumentState oldState, DocumentState newState) 93private readonly ImmutableArray<DocumentState> _documents; 95public RemoveDocumentsAction(ImmutableArray<DocumentState> documents) 103foreach (var document in _documents) 118private readonly ImmutableArray<DocumentState> _documents; 120public AddDocumentsAction(ImmutableArray<DocumentState> documents) 128foreach (var document in _documents) 156foreach (var documentState in _state.DocumentStates.GetStatesInCompilationOrder())
Workspace\Solution\SolutionState.CompilationTracker.cs (4)
166public ICompilationTracker FreezePartialStateWithTree(SolutionState solution, DocumentState docState, SyntaxTree tree, CancellationToken cancellationToken) 195if (inProgressProject.DocumentStates.TryGetState(docState.Id, out var oldState)) 224var oldDocumentId = DocumentState.GetDocumentIdForTree(oldTree); 551foreach (var documentState in ProjectState.DocumentStates.GetStatesInCompilationOrder())
Workspace\Solution\SolutionState.cs (22)
331private DocumentState GetRequiredDocumentState(DocumentId documentId) 340internal DocumentState? GetDocumentState(SyntaxTree? syntaxTree, ProjectId? projectId) 345var documentId = DocumentState.GetDocumentIdForTree(syntaxTree); 352var document = projectState.DocumentStates.GetState(documentId); 1217var oldDocument = GetRequiredDocumentState(documentId); 1232var oldDocument = GetRequiredDocumentState(documentId); 1246var oldDocument = GetRequiredDocumentState(documentId); 1261var oldDocument = GetRequiredDocumentState(documentId); 1306var oldDocument = GetRequiredDocumentState(documentId); 1351var oldDocument = GetRequiredDocumentState(documentId); 1362public SolutionState WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState) 1364var oldDocument = GetRequiredDocumentState(documentId); 1381DocumentState oldDocument, 1382DocumentState newDocument, 1396var oldDocument = GetRequiredDocumentState(documentId); 1407var oldDocument = GetRequiredDocumentState(documentId); 1440private SolutionState UpdateDocumentState(DocumentState newDocument, bool contentChanged) 1448var oldDocument = oldProject.DocumentStates.GetRequiredState(newDocument.Id); 1637using var _ = ArrayBuilder<(DocumentState, SyntaxTree)>.GetInstance(allDocumentIds.Length, out var builder); 1641var document = this.GetRequiredDocumentState(currentDocumentId); 1709var documentState = projectState.DocumentStates.GetState(documentId); 1756var doc = GetProjectState(documentId.ProjectId)?.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionState.GeneratedFileReplacingCompilationTracker.cs (1)
69public ICompilationTracker FreezePartialStateWithTree(SolutionState solution, DocumentState docState, SyntaxTree tree, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.ICompilationTracker.cs (1)
38ICompilationTracker FreezePartialStateWithTree(SolutionState solution, DocumentState docState, SyntaxTree tree, CancellationToken cancellationToken);
Workspace\Solution\SolutionState.SymbolToProjectId.cs (1)
138var doc = this.GetDocumentState(tree, projectId: null);
Workspace\Workspace.cs (1)
1467var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ??