3 types derived from GeneratorDiagnostic
Microsoft.Interop.SourceGeneration (3)
Marshalling\GeneratorDiagnostic.cs (3)
28
public sealed record NotSupported(TypePositionInfo TypePositionInfo) :
GeneratorDiagnostic
(TypePositionInfo, isFatal: true)
45
public sealed record UnnecessaryData(TypePositionInfo TypePositionInfo, ImmutableArray<Location> UnnecessaryDataLocations) :
GeneratorDiagnostic
(TypePositionInfo, isFatal: false)
64
public sealed record NotRecommended(TypePositionInfo TypePositionInfo) :
GeneratorDiagnostic
(TypePositionInfo, isFatal: false)
82 references to GeneratorDiagnostic
Microsoft.Interop.ComInterfaceGenerator (14)
DiagnosticDescriptorProvider.cs (8)
19
public DiagnosticDescriptor? GetDescriptor(
GeneratorDiagnostic
diagnostic)
23
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: null, TypePositionInfo: { IsManagedReturnPosition: true, MarshallingAttributeInfo: MarshalAsInfo } } => GeneratorDiagnostics.MarshalAsReturnConfigurationNotSupported,
24
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: null, TypePositionInfo: { IsManagedReturnPosition: false, MarshallingAttributeInfo: MarshalAsInfo } } => GeneratorDiagnostics.MarshalAsParameterConfigurationNotSupported,
25
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.ReturnTypeNotSupportedWithDetails,
26
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails,
27
GeneratorDiagnostic
.UnnecessaryData { TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.UnnecessaryParameterMarshallingInfo,
28
GeneratorDiagnostic
.UnnecessaryData { TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.UnnecessaryReturnMarshallingInfo,
29
GeneratorDiagnostic
.NotRecommended => GeneratorDiagnostics.GeneratedComInterfaceUsageDoesNotFollowBestPractices,
Marshallers\ComInterfaceDispatchMarshallingResolver.cs (1)
67
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshallers\KeepAliveThisMarshaller.cs (1)
35
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (2)
58
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
95
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshallers\ObjectUnwrapperResolver.cs (1)
62
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshallers\StructAsHResultMarshallerFactory.cs (1)
94
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Microsoft.Interop.JavaScript.JSImportGenerator (7)
DescriptorProvider.cs (3)
16
public DiagnosticDescriptor? GetDescriptor(
GeneratorDiagnostic
diagnostic)
20
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.ReturnTypeNotSupportedWithDetails,
21
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails,
JSExportCodeGenerator.cs (1)
59
diagnosticsBag.ReportGeneratorDiagnostic(new
GeneratorDiagnostic
.NotSupported(spanArg.TypeInfo)
JSImportCodeGenerator.cs (1)
66
diagnosticsBag.ReportGeneratorDiagnostic(new
GeneratorDiagnostic
.NotSupported(spanArg.TypeInfo)
Marshaling\BaseJSGenerator.cs (1)
36
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, out
GeneratorDiagnostic
? diagnostic)
Marshaling\EmptyJSGenerator.cs (1)
16
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Microsoft.Interop.LibraryImportGenerator (8)
DiagnosticDescriptorProvider.cs (8)
17
public DiagnosticDescriptor? GetDescriptor(
GeneratorDiagnostic
diagnostic)
21
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: null, TypePositionInfo: { IsManagedReturnPosition: true, MarshallingAttributeInfo: MarshalAsInfo } } => GeneratorDiagnostics.MarshalAsReturnConfigurationNotSupported,
22
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: null, TypePositionInfo: { IsManagedReturnPosition: false, MarshallingAttributeInfo: MarshalAsInfo } } => GeneratorDiagnostics.MarshalAsParameterConfigurationNotSupported,
23
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.ReturnTypeNotSupportedWithDetails,
24
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails,
25
GeneratorDiagnostic
.UnnecessaryData { TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.UnnecessaryParameterMarshallingInfo,
26
GeneratorDiagnostic
.UnnecessaryData { TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.UnnecessaryReturnMarshallingInfo,
27
GeneratorDiagnostic
.NotRecommended => GeneratorDiagnostics.LibraryImportUsageDoesNotFollowBestPractices,
Microsoft.Interop.LibraryImportGenerator.Downlevel (8)
DiagnosticDescriptorProvider.cs (8)
17
public DiagnosticDescriptor? GetDescriptor(
GeneratorDiagnostic
diagnostic)
21
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: null, TypePositionInfo: { IsManagedReturnPosition: true, MarshallingAttributeInfo: MarshalAsInfo } } => GeneratorDiagnostics.MarshalAsReturnConfigurationNotSupported,
22
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: null, TypePositionInfo: { IsManagedReturnPosition: false, MarshallingAttributeInfo: MarshalAsInfo } } => GeneratorDiagnostics.MarshalAsParameterConfigurationNotSupported,
23
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.ReturnTypeNotSupportedWithDetails,
24
GeneratorDiagnostic
.NotSupported { NotSupportedDetails: not null, TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails,
25
GeneratorDiagnostic
.UnnecessaryData { TypePositionInfo.IsManagedReturnPosition: false } => GeneratorDiagnostics.UnnecessaryParameterMarshallingInfo,
26
GeneratorDiagnostic
.UnnecessaryData { TypePositionInfo.IsManagedReturnPosition: true } => GeneratorDiagnostics.UnnecessaryReturnMarshallingInfo,
27
GeneratorDiagnostic
.NotRecommended => GeneratorDiagnostics.LibraryImportUsageDoesNotFollowBestPractices,
Microsoft.Interop.SourceGeneration (45)
BoundGenerators.cs (3)
21
public static BoundGenerators Create(ImmutableArray<TypePositionInfo> elementTypeInfo, IMarshallingGeneratorResolver generatorResolver, StubCodeContext context, IUnboundMarshallingGenerator fallbackGenerator, out ImmutableArray<
GeneratorDiagnostic
> generatorBindingDiagnostics)
29
ImmutableArray<
GeneratorDiagnostic
>.Builder generatorDiagnostics = ImmutableArray.CreateBuilder<
GeneratorDiagnostic
>();
GeneratorDiagnosticsBag.cs (3)
94
public void ReportGeneratorDiagnostic(
GeneratorDiagnostic
diagnostic)
113
public void ReportGeneratorDiagnostics(ImmutableArray<
GeneratorDiagnostic
> diagnostics)
115
foreach (
var
diagnostic in diagnostics)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (10)
53
private record struct ExpressionOrNotSupported(ExpressionSyntax? Expression,
GeneratorDiagnostic
.NotSupported? NotSupported)
59
public ExpressionOrNotSupported(
GeneratorDiagnostic
.NotSupported notSupportedDiagnostic)
65
private
GeneratorDiagnostic
.NotSupported? ValidateCountInfo(TypePositionInfo info, CountInfo count, StubCodeContext context, out bool countInfoRequiresCast)
74
_ => new
GeneratorDiagnostic
.NotSupported(info)
80
GeneratorDiagnostic
.NotSupported? ValidateNumElementsExpression(TypePositionInfo paramInfo, out bool requiresCast)
96
return new
GeneratorDiagnostic
.NotSupported(info)
105
return new
GeneratorDiagnostic
.NotSupported(info)
146
if (ValidateCustomNativeTypeMarshallingSupported(info, context, marshalInfo) is
GeneratorDiagnostic
.NotSupported diagnostic)
234
GeneratorDiagnostic
.NotSupported? countInfoDiagnostic = ValidateCountInfo(info, countInfo, context, out countInfoRequiresCast);
417
private
GeneratorDiagnostic
.NotSupported? ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info, StubCodeContext context, NativeMarshallingAttributeInfo marshalInfo)
Marshalling\BlittableMarshaller.cs (1)
102
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshalling\BlittableMarshallerResolver.cs (1)
34
context, new
GeneratorDiagnostic
.NotSupported(info)
Marshalling\BoolMarshaller.cs (1)
100
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshalling\BreakingChangeDetector.cs (1)
32
new
GeneratorDiagnostic
.NotRecommended(info)
Marshalling\ByValueContentsMarshalKindValidator.cs (1)
37
var support = generator.Generator.SupportsByValueMarshalKind(generator.Generator.TypeInfo.ByValueContentsMarshalKind, out
GeneratorDiagnostic
? diagnostic);
Marshalling\ByValueMarshalKindSupportDescriptor.cs (8)
12
public ByValueMarshalKindSupport GetSupport(TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
18
new
GeneratorDiagnostic
.NotRecommended(info)
23
new
GeneratorDiagnostic
.UnnecessaryData(
31
new
GeneratorDiagnostic
.NotSupported(info)
42
/// Provides an implementation of <see cref="IUnboundMarshallingGenerator.SupportsByValueMarshalKind(ByValueContentsMarshalKind, TypePositionInfo, out
GeneratorDiagnostic
?)"/> through <see cref="GetSupport(ByValueContentsMarshalKind, TypePositionInfo, out
GeneratorDiagnostic
?)"/>
71
public ByValueMarshalKindSupport GetSupport(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
78
diagnostic = new
GeneratorDiagnostic
.NotSupported(info)
Marshalling\CharMarshaller.cs (1)
137
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshalling\CustomTypeMarshallingGenerator.cs (1)
99
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, out
GeneratorDiagnostic
? diagnostic)
Marshalling\DelegateMarshaller.cs (1)
95
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshalling\Forwarder.cs (1)
34
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, TypePositionInfo info, out
GeneratorDiagnostic
? diagnostic)
Marshalling\MarshallingGenerator.cs (2)
148
ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, out
GeneratorDiagnostic
? diagnostic);
174
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, out
GeneratorDiagnostic
? diagnostic)
Marshalling\ResolvedGenerator.cs (6)
10
public record struct ResolvedGenerator([property: MemberNotNullWhen(true, nameof(ResolvedGenerator.IsResolved), nameof(ResolvedGenerator.IsResolvedWithoutErrors))] IBoundMarshallingGenerator? Generator, ImmutableArray<
GeneratorDiagnostic
> Diagnostics)
22
return new(generator, ImmutableArray<
GeneratorDiagnostic
>.Empty);
25
public static ResolvedGenerator NotSupported(TypePositionInfo info, StubCodeContext context,
GeneratorDiagnostic
.NotSupported notSupportedDiagnostic)
27
return new(s_forwarder.Bind(info, context), ImmutableArray.Create<
GeneratorDiagnostic
>(notSupportedDiagnostic));
30
public static ResolvedGenerator ResolvedWithDiagnostics(IBoundMarshallingGenerator generator, ImmutableArray<
GeneratorDiagnostic
> diagnostics)
35
public static ResolvedGenerator UnresolvedGenerator { get; } = new(null, ImmutableArray<
GeneratorDiagnostic
>.Empty);
Marshalling\StaticPinnableManagedValueMarshaller.cs (1)
99
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind, out
GeneratorDiagnostic
? diagnostic)
MethodSignatureDiagnosticLocations.cs (3)
37
DiagnosticDescriptor? GetDescriptor(
GeneratorDiagnostic
diagnostic);
42
DiagnosticInfo CreateDiagnosticInfo(DiagnosticDescriptor descriptor,
GeneratorDiagnostic
diagnostic);
61
public DiagnosticInfo CreateDiagnosticInfo(DiagnosticDescriptor descriptor,
GeneratorDiagnostic
diagnostic)