3 instantiations of SourceGeneratedDocumentState
Microsoft.CodeAnalysis.Workspaces (3)
Workspace\Solution\SourceGeneratedDocumentState.cs (3)
111
return new
SourceGeneratedDocumentState
(
213
return
new
(
247
return
new
(
83 references to SourceGeneratedDocumentState
Microsoft.CodeAnalysis.Features (4)
EditAndContinue\EditSession.cs (4)
519
var
newState = newSourceGeneratedDocumentStates.GetRequiredState(documentId);
530
var
newState = newSourceGeneratedDocumentStates.GetRequiredState(documentId);
541
var
oldState = oldSourceGeneratedDocumentStates.GetRequiredState(documentId);
551
private static async ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(TraceLog log, Project project, ArrayBuilder<Diagnostic>? diagnostics, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Workspaces\LspWorkspaceManager.cs (2)
490
var
existingState = compilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(identity.DocumentId);
497
var
newState = existingState.WithText(text);
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\TestUtils.cs (1)
195
foreach (
var
frozenSourceGeneratedDocumentState in solution.CompilationState.FrozenSourceGeneratedDocumentStates.States.Values)
Services\SourceGeneration\RemoteSourceGenerationService.cs (1)
66
var
state = documentStates.GetRequiredState(id);
Microsoft.CodeAnalysis.Workspaces (75)
SourceGeneration\IRemoteSourceGenerationService.cs (1)
83
/// cref="
SourceGeneratedDocumentState
.GetOriginalSourceTextContentHash"/> for more details on when this happens.</param>
Workspace\Solution\Project.cs (5)
351
var
generatedDocumentState = generatedDocumentStates.GetState(documentId);
358
internal SourceGeneratedDocument GetOrCreateSourceGeneratedDocument(
SourceGeneratedDocumentState
state)
362
/// Returns the <see cref="
SourceGeneratedDocumentState
"/> for a source generated document that has already been generated and observed.
385
var
documentState = Solution.CompilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentId);
505
private static readonly Func<DocumentId, (
SourceGeneratedDocumentState
state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction =
Workspace\Solution\Solution.cs (2)
332
if (documentState is
SourceGeneratedDocumentState
)
1677
var
newDocumentState = newCompilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentIdentity.DocumentId);
Workspace\Solution\SolutionChanges.cs (3)
100
using var _ = ArrayBuilder<
SourceGeneratedDocumentState
>.GetInstance(out var oldStateBuilder);
103
var
oldState = OldSolution.CompilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(id);
107
var oldStates = new TextDocumentStates<
SourceGeneratedDocumentState
>(oldStateBuilder);
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 (16)
44
public TextDocumentStates<
SourceGeneratedDocumentState
> FrozenSourceGeneratedDocumentStates { get; }
67
TextDocumentStates<
SourceGeneratedDocumentState
> frozenSourceGeneratedDocumentStates,
101
frozenSourceGeneratedDocumentStates: TextDocumentStates<
SourceGeneratedDocumentState
>.Empty)
125
TextDocumentStates<
SourceGeneratedDocumentState
>? frozenSourceGeneratedDocumentStates = null,
1249
public ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(ProjectState project, CancellationToken cancellationToken)
1253
public ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
1258
: new(TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
1278
/// Returns the <see cref="
SourceGeneratedDocumentState
"/> for a source generated document that has already been generated and observed.
1285
public
SourceGeneratedDocumentState
? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(
1396
frozenSourceGeneratedDocumentStates: TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
1411
using var _ = PooledDictionary<DocumentId,
SourceGeneratedDocumentState
>.GetInstance(out var documentStates);
1417
var
existingGeneratedState = TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentIdentity.DocumentId);
1420
var
newGeneratedState = existingGeneratedState
1444
var
newGeneratedState =
SourceGeneratedDocumentState
.Create(
1501
frozenSourceGeneratedDocumentStates: new TextDocumentStates<
SourceGeneratedDocumentState
>(documentStates.Values));
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (2)
65
ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
73
SourceGeneratedDocumentState
? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
861
public async ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
870
return TextDocumentStates<
SourceGeneratedDocumentState
>.Empty;
916
public
SourceGeneratedDocumentState
? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (19)
101
private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
> generatedDocuments)?> TryComputeNewGeneratorInfoInRemoteProcessAsync(
104
TextDocumentStates<
SourceGeneratedDocumentState
> oldGeneratedDocuments,
152
return (compilationWithoutGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
164
var
existingDocument = oldGeneratedDocuments.GetState(documentId);
223
using var generatedDocumentsBuilder = TemporaryArray<
SourceGeneratedDocumentState
>.Empty;
236
var
generatedDocument =
SourceGeneratedDocumentState
.Create(
252
var
existingDocument = oldGeneratedDocuments.GetRequiredState(documentId);
264
var newGeneratedDocuments = new TextDocumentStates<
SourceGeneratedDocumentState
>(generatedDocumentsBuilder.ToImmutableAndClear());
271
private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
> generatedDocuments, GeneratorDriver? generatorDriver)> ComputeNewGeneratorInfoInCurrentProcessAsync(
274
TextDocumentStates<
SourceGeneratedDocumentState
> oldGeneratedDocuments,
282
return (compilationWithoutGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
>.Empty, generatorDriver);
350
using var generatedDocumentsBuilder = TemporaryArray<
SourceGeneratedDocumentState
>.Empty;
360
var
existing = FindExistingGeneratedDocumentState(
368
var
newDocument = existing
394
SourceGeneratedDocumentState
.Create(
422
var newGeneratedDocuments = new TextDocumentStates<
SourceGeneratedDocumentState
>(generatedDocumentsBuilder.ToImmutableAndClear());
428
static
SourceGeneratedDocumentState
? FindExistingGeneratedDocumentState(
429
TextDocumentStates<
SourceGeneratedDocumentState
> states,
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
39
var
generatedDocument = this.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentId);
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (7)
30
private readonly TextDocumentStates<
SourceGeneratedDocumentState
> _replacementDocumentStates;
51
TextDocumentStates<
SourceGeneratedDocumentState
> replacementDocumentStates)
105
public ICompilationTracker WithReplacementDocumentStates(TextDocumentStates<
SourceGeneratedDocumentState
> replacementDocumentStates)
127
underlyingSourceGeneratedDocuments.TryGetState(id, out
var
existingState);
159
public async ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
203
public
SourceGeneratedDocumentState
? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId)
205
if (_replacementDocumentStates.TryGetState(documentId, out
var
replacementState))
Workspace\Solution\SourceGeneratedDocument.cs (3)
16
internal SourceGeneratedDocument(Project project,
SourceGeneratedDocumentState
state)
21
private new
SourceGeneratedDocumentState
State => (
SourceGeneratedDocumentState
)base.State;
Workspace\Solution\SourceGeneratedDocumentState.cs (7)
42
public static
SourceGeneratedDocumentState
Create(
53
public static
SourceGeneratedDocumentState
Create(
81
private static
SourceGeneratedDocumentState
Create(
171
public
SourceGeneratedDocumentState
WithText(SourceText sourceText)
188
public
SourceGeneratedDocumentState
WithParseOptions(ParseOptions parseOptions)
205
public
SourceGeneratedDocumentState
WithGenerationDateTime(DateTime generationDateTime)
227
public
SourceGeneratedDocumentState
WithSyntaxRoot(SyntaxNode newRoot)
Workspace\Solution\StateChecksums.cs (2)
147
Contract.ThrowIfFalse(compilationState.FrozenSourceGeneratedDocumentStates.TryGetState(documentId, out
var
state));
161
Contract.ThrowIfFalse(compilationState.FrozenSourceGeneratedDocumentStates.TryGetState(id, out
var
state));