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)
515
var
newState = newSourceGeneratedDocumentStates.GetRequiredState(documentId);
526
var
newState = newSourceGeneratedDocumentStates.GetRequiredState(documentId);
537
var
oldState = oldSourceGeneratedDocumentStates.GetRequiredState(documentId);
547
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)
333
if (documentState is
SourceGeneratedDocumentState
)
1640
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; }
66
TextDocumentStates<
SourceGeneratedDocumentState
> frozenSourceGeneratedDocumentStates,
102
frozenSourceGeneratedDocumentStates: TextDocumentStates<
SourceGeneratedDocumentState
>.Empty)
125
TextDocumentStates<
SourceGeneratedDocumentState
>? frozenSourceGeneratedDocumentStates = null,
1237
public ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(ProjectState project, CancellationToken cancellationToken)
1241
public ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
1246
: new(TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
1266
/// Returns the <see cref="
SourceGeneratedDocumentState
"/> for a source generated document that has already been generated and observed.
1273
public
SourceGeneratedDocumentState
? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(
1384
frozenSourceGeneratedDocumentStates: TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
1399
using var _ = PooledDictionary<DocumentId,
SourceGeneratedDocumentState
>.GetInstance(out var documentStates);
1405
var
existingGeneratedState = TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentIdentity.DocumentId);
1408
var
newGeneratedState = existingGeneratedState
1432
var
newGeneratedState =
SourceGeneratedDocumentState
.Create(
1489
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)
852
public async ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
861
return TextDocumentStates<
SourceGeneratedDocumentState
>.Empty;
907
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,
142
return (compilationWithoutGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
154
var
existingDocument = oldGeneratedDocuments.GetState(documentId);
209
using var generatedDocumentsBuilder = TemporaryArray<
SourceGeneratedDocumentState
>.Empty;
222
var
generatedDocument =
SourceGeneratedDocumentState
.Create(
238
var
existingDocument = oldGeneratedDocuments.GetRequiredState(documentId);
250
var newGeneratedDocuments = new TextDocumentStates<
SourceGeneratedDocumentState
>(generatedDocumentsBuilder.ToImmutableAndClear());
257
private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
> generatedDocuments, GeneratorDriver? generatorDriver)> ComputeNewGeneratorInfoInCurrentProcessAsync(
260
TextDocumentStates<
SourceGeneratedDocumentState
> oldGeneratedDocuments,
268
return (compilationWithoutGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
>.Empty, generatorDriver);
327
using var generatedDocumentsBuilder = TemporaryArray<
SourceGeneratedDocumentState
>.Empty;
337
var
existing = FindExistingGeneratedDocumentState(
345
var
newDocument = existing
371
SourceGeneratedDocumentState
.Create(
399
var newGeneratedDocuments = new TextDocumentStates<
SourceGeneratedDocumentState
>(generatedDocumentsBuilder.ToImmutableAndClear());
405
static
SourceGeneratedDocumentState
? FindExistingGeneratedDocumentState(
406
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));