1 instantiation of SourceGeneratedDocumentState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
180return new(
61 references to SourceGeneratedDocumentState
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Workspaces\LspWorkspaceManager.cs (2)
484var existingState = compilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(identity.DocumentId); 491var newState = existingState.WithText(text);
Microsoft.CodeAnalysis.Workspaces (59)
SourceGeneration\IRemoteSourceGenerationService.cs (1)
76/// cref="SourceGeneratedDocumentState.GetOriginalSourceTextContentHash"/> for more details on when this happens.</param>
Workspace\Solution\Project.cs (3)
327internal SourceGeneratedDocument GetOrCreateSourceGeneratedDocument(SourceGeneratedDocumentState state) 331/// Returns the <see cref="SourceGeneratedDocumentState"/> for a source generated document that has already been generated and observed. 474private static readonly Func<DocumentId, (SourceGeneratedDocumentState state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction =
Workspace\Solution\Solution.cs (1)
321if (documentState is SourceGeneratedDocumentState)
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
103foreach (var generatedDocument in generatorInfo.Documents.States.Values) 203foreach (var generatedDocument in generatorInfo.Documents.States.Values)
Workspace\Solution\SolutionCompilationState.CompilationTrackerGeneratorInfo.cs (2)
20TextDocumentStates<SourceGeneratedDocumentState> Documents, 24new(TextDocumentStates<SourceGeneratedDocumentState>.Empty, Driver: null);
Workspace\Solution\SolutionCompilationState.cs (11)
44public TextDocumentStates<SourceGeneratedDocumentState>? FrozenSourceGeneratedDocumentStates { get; } 64TextDocumentStates<SourceGeneratedDocumentState>? frozenSourceGeneratedDocumentStates, 119Optional<TextDocumentStates<SourceGeneratedDocumentState>?> frozenSourceGeneratedDocumentStates = default, 1188public ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(ProjectState project, CancellationToken cancellationToken) 1192public ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync( 1197: new(TextDocumentStates<SourceGeneratedDocumentState>.Empty); 1217/// Returns the <see cref="SourceGeneratedDocumentState"/> for a source generated document that has already been generated and observed. 1224public SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId( 1350using var _ = ArrayBuilder<SourceGeneratedDocumentState>.GetInstance(documents.Length, out var documentStates); 1369var newGeneratedState = SourceGeneratedDocumentState.Create( 1412frozenSourceGeneratedDocumentStates: new TextDocumentStates<SourceGeneratedDocumentState>(documentStates));
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (2)
66ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync( 74SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
842public async ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync( 851return TextDocumentStates<SourceGeneratedDocumentState>.Empty; 897public SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (18)
75private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<SourceGeneratedDocumentState> generatedDocuments)?> TryComputeNewGeneratorInfoInRemoteProcessAsync( 78TextDocumentStates<SourceGeneratedDocumentState> oldGeneratedDocuments, 113return (compilationWithoutGeneratedFiles, TextDocumentStates<SourceGeneratedDocumentState>.Empty); 125var existingDocument = oldGeneratedDocuments.GetState(documentId); 180using var generatedDocumentsBuilder = TemporaryArray<SourceGeneratedDocumentState>.Empty; 193var generatedDocument = SourceGeneratedDocumentState.Create( 209var existingDocument = oldGeneratedDocuments.GetRequiredState(documentId); 221var newGeneratedDocuments = new TextDocumentStates<SourceGeneratedDocumentState>(generatedDocumentsBuilder.ToImmutableAndClear()); 228private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<SourceGeneratedDocumentState> generatedDocuments, GeneratorDriver? generatorDriver)> ComputeNewGeneratorInfoInCurrentProcessAsync( 231TextDocumentStates<SourceGeneratedDocumentState> oldGeneratedDocuments, 238return (compilationWithoutGeneratedFiles, TextDocumentStates<SourceGeneratedDocumentState>.Empty, generatorDriver); 291using var generatedDocumentsBuilder = TemporaryArray<SourceGeneratedDocumentState>.Empty; 301var existing = FindExistingGeneratedDocumentState( 309var newDocument = existing 335SourceGeneratedDocumentState.Create( 363var newGeneratedDocuments = new TextDocumentStates<SourceGeneratedDocumentState>(generatedDocumentsBuilder.ToImmutableAndClear()); 369static SourceGeneratedDocumentState? FindExistingGeneratedDocumentState( 370TextDocumentStates<SourceGeneratedDocumentState> states,
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (6)
29private readonly TextDocumentStates<SourceGeneratedDocumentState> _replacementDocumentStates; 52TextDocumentStates<SourceGeneratedDocumentState> replacementDocumentStates) 116underlyingSourceGeneratedDocuments.TryGetState(id, out var existingState); 170public async ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync( 214public SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId) 216if (_replacementDocumentStates.TryGetState(documentId, out var replacementState))
Workspace\Solution\SourceGeneratedDocument.cs (3)
15internal SourceGeneratedDocument(Project project, SourceGeneratedDocumentState state) 20private new SourceGeneratedDocumentState State => (SourceGeneratedDocumentState)base.State;
Workspace\Solution\SourceGeneratedDocumentState.cs (5)
44public static SourceGeneratedDocumentState Create( 61private static SourceGeneratedDocumentState Create( 139public SourceGeneratedDocumentState WithText(SourceText sourceText) 156public SourceGeneratedDocumentState WithParseOptions(ParseOptions parseOptions) 172public SourceGeneratedDocumentState WithGenerationDateTime(DateTime generationDateTime)
Workspace\Solution\StateChecksums.cs (2)
168Contract.ThrowIfFalse(compilationState.FrozenSourceGeneratedDocumentStates.TryGetState(documentId, out var state)); 182Contract.ThrowIfFalse(compilationState.FrozenSourceGeneratedDocumentStates.TryGetState(id, out var state));