27 references to SourceGeneratorPresence
Microsoft.CodeAnalysis.Remote.ServiceHub (10)
Services\SourceGeneration\RemoteSourceGenerationService.cs (10)
22
using AnalyzerReferenceMap = ConditionalWeakTable<AnalyzerReference, StrongBox<
SourceGeneratorPresence
>>;
81
private static StrongBox<
SourceGeneratorPresence
> GetSourceGeneratorPresence(
88
public async ValueTask<
SourceGeneratorPresence
> GetSourceGeneratorPresenceAsync(
96
return
SourceGeneratorPresence
.NoSourceGenerators;
132
var
generatorPresence = analyzerReferenceMap.GetValue(analyzerReference, callback).Value;
135
if (generatorPresence is
SourceGeneratorPresence
.ContainsRequiredSourceGenerators)
136
return
SourceGeneratorPresence
.ContainsRequiredSourceGenerators;
140
if (generatorPresence is
SourceGeneratorPresence
.OnlyOptionalSourceGenerators)
146
?
SourceGeneratorPresence
.OnlyOptionalSourceGenerators
147
:
SourceGeneratorPresence
.NoSourceGenerators;
Microsoft.CodeAnalysis.Workspaces (17)
SourceGeneration\IRemoteSourceGenerationService.cs (1)
52
ValueTask<
SourceGeneratorPresence
> GetSourceGeneratorPresenceAsync(
SourceGeneration\SourceGeneratorExtensions.cs (4)
34
public static
SourceGeneratorPresence
GetSourceGeneratorPresence(this ImmutableArray<ISourceGenerator> generators)
37
return
SourceGeneratorPresence
.NoSourceGenerators;
41
?
SourceGeneratorPresence
.ContainsRequiredSourceGenerators
42
:
SourceGeneratorPresence
.OnlyOptionalSourceGenerators;
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
99
var
presence = await compilationState.GetProjectGeneratorPresenceAsync(ProjectState.Id, cancellationToken).ConfigureAwait(false);
100
return presence is
SourceGeneratorPresence
.ContainsRequiredSourceGenerators;
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (10)
25
using AnalyzerReferenceMap = ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, AsyncLazy<
SourceGeneratorPresence
>>;
107
var
state = await GetProjectGeneratorPresenceAsync(projectId, cancellationToken).ConfigureAwait(false);
108
return state is not
SourceGeneratorPresence
.NoSourceGenerators;
111
public async Task<
SourceGeneratorPresence
> GetProjectGeneratorPresenceAsync(ProjectId projectId, CancellationToken cancellationToken)
115
return
SourceGeneratorPresence
.NoSourceGenerators;
118
return
SourceGeneratorPresence
.NoSourceGenerators;
129
AsyncLazy<
SourceGeneratorPresence
> GetLazy(AnalyzerReferenceMap analyzerReferenceMap, ProjectState projectState)
135
static async Task<
SourceGeneratorPresence
> ComputeHasSourceGeneratorsAsync(
149
var result = await client.TryInvokeAsync<IRemoteSourceGenerationService,
SourceGeneratorPresence
>(
154
return result.HasValue ? result.Value :
SourceGeneratorPresence
.NoSourceGenerators;