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)
489
var
existingState = compilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(identity.DocumentId);
496
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
)
1639
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; }
64
TextDocumentStates<
SourceGeneratedDocumentState
> frozenSourceGeneratedDocumentStates,
96
frozenSourceGeneratedDocumentStates: TextDocumentStates<
SourceGeneratedDocumentState
>.Empty)
119
TextDocumentStates<
SourceGeneratedDocumentState
>? frozenSourceGeneratedDocumentStates = null,
1230
public ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(ProjectState project, CancellationToken cancellationToken)
1234
public ValueTask<TextDocumentStates<
SourceGeneratedDocumentState
>> GetSourceGeneratedDocumentStatesAsync(
1239
: new(TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
1259
/// Returns the <see cref="
SourceGeneratedDocumentState
"/> for a source generated document that has already been generated and observed.
1266
public
SourceGeneratedDocumentState
? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(
1377
frozenSourceGeneratedDocumentStates: TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
1392
using var _ = PooledDictionary<DocumentId,
SourceGeneratedDocumentState
>.GetInstance(out var documentStates);
1398
var
existingGeneratedState = TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentIdentity.DocumentId);
1401
var
newGeneratedState = existingGeneratedState
1425
var
newGeneratedState =
SourceGeneratedDocumentState
.Create(
1482
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)
103
private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
> generatedDocuments)?> TryComputeNewGeneratorInfoInRemoteProcessAsync(
106
TextDocumentStates<
SourceGeneratedDocumentState
> oldGeneratedDocuments,
144
return (compilationWithoutGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
>.Empty);
156
var
existingDocument = oldGeneratedDocuments.GetState(documentId);
211
using var generatedDocumentsBuilder = TemporaryArray<
SourceGeneratedDocumentState
>.Empty;
224
var
generatedDocument =
SourceGeneratedDocumentState
.Create(
240
var
existingDocument = oldGeneratedDocuments.GetRequiredState(documentId);
252
var newGeneratedDocuments = new TextDocumentStates<
SourceGeneratedDocumentState
>(generatedDocumentsBuilder.ToImmutableAndClear());
259
private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
> generatedDocuments, GeneratorDriver? generatorDriver)> ComputeNewGeneratorInfoInCurrentProcessAsync(
262
TextDocumentStates<
SourceGeneratedDocumentState
> oldGeneratedDocuments,
270
return (compilationWithoutGeneratedFiles, TextDocumentStates<
SourceGeneratedDocumentState
>.Empty, generatorDriver);
329
using var generatedDocumentsBuilder = TemporaryArray<
SourceGeneratedDocumentState
>.Empty;
339
var
existing = FindExistingGeneratedDocumentState(
347
var
newDocument = existing
373
SourceGeneratedDocumentState
.Create(
401
var newGeneratedDocuments = new TextDocumentStates<
SourceGeneratedDocumentState
>(generatedDocumentsBuilder.ToImmutableAndClear());
407
static
SourceGeneratedDocumentState
? FindExistingGeneratedDocumentState(
408
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));