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