3 instantiations of DiagnosticInfo
Microsoft.Interop.SourceGeneration (3)
DiagnosticInfo.cs (3)
28
return new
DiagnosticInfo
()
40
return new
DiagnosticInfo
()
52
return new
DiagnosticInfo
()
147 references to DiagnosticInfo
Microsoft.Interop.ComInterfaceGenerator (52)
ComClassInfo.cs (3)
30
return DiagnosticOr<ComClassInfo>.From(
DiagnosticInfo
.Create(GeneratorDiagnostics.RequiresAllowUnsafeBlocks, syntax.Identifier.GetLocation()));
36
DiagnosticInfo
.Create(
58
return DiagnosticOr<ComClassInfo>.From(
DiagnosticInfo
.Create(GeneratorDiagnostics.ClassDoesNotImplementAnyGeneratedComInterface,
ComInterfaceContext.cs (1)
71
DiagnosticInfo
.Create(
ComInterfaceGenerator.cs (2)
308
generatorDiagnostics.ReportDiagnostic(
DiagnosticInfo
.Create(GeneratorDiagnostics.ComMethodManagedReturnWillBeOutVariable, symbol.Locations[0]));
344
generatorDiagnostics.ReportDiagnostic(
DiagnosticInfo
.Create(
ComInterfaceInfo.cs (25)
58
return DiagnosticOrInterfaceInfo.From(
DiagnosticInfo
.Create(GeneratorDiagnostics.RequiresAllowUnsafeBlocks, syntax.Identifier.GetLocation()));
64
DiagnosticInfo
.Create(
70
if (!IsInPartialContext(symbol, syntax, out
DiagnosticInfo
? partialContextDiagnostic))
75
return DiagnosticOrInterfaceInfo.From(
DiagnosticInfo
.Create(
82
if (!TryGetGuid(symbol, syntax, out Guid? guid, out
DiagnosticInfo
? guidDiagnostic))
85
if (!TryGetBaseComInterface(symbol, syntax, out INamedTypeSymbol? baseSymbol, out
DiagnosticInfo
? baseDiagnostic))
91
if (!StringMarshallingIsValid(symbol, syntax, interfaceAttributeData, baseAttributeData, out
DiagnosticInfo
? stringMarshallingDiagnostic))
94
if (!OptionsAreValid(symbol, syntax, interfaceAttributeData, baseAttributeData, out
DiagnosticInfo
? optionsDiagnostic))
112
ImmutableArray<
DiagnosticInfo
>.Builder nonFatalDiagnostics = ImmutableArray.CreateBuilder<
DiagnosticInfo
>();
124
nonFatalDiagnostics.Add(
DiagnosticInfo
.Create(
176
private static bool IsInPartialContext(INamedTypeSymbol symbol, InterfaceDeclarationSyntax syntax, [NotNullWhen(false)] out
DiagnosticInfo
? diagnostic)
181
diagnostic =
DiagnosticInfo
.Create(
197
[NotNullWhen(false)] out
DiagnosticInfo
? stringMarshallingDiagnostic)
206
stringMarshallingDiagnostic =
DiagnosticInfo
.Create(
215
stringMarshallingDiagnostic =
DiagnosticInfo
.Create(
225
stringMarshallingDiagnostic =
DiagnosticInfo
.Create(
240
stringMarshallingDiagnostic =
DiagnosticInfo
.Create(
257
[NotNullWhen(false)] out
DiagnosticInfo
? optionsDiagnostic)
262
optionsDiagnostic =
DiagnosticInfo
.Create(
276
optionsDiagnostic =
DiagnosticInfo
.Create(
291
private static bool TryGetBaseComInterface(INamedTypeSymbol comIface, InterfaceDeclarationSyntax? syntax, out INamedTypeSymbol? baseComIface, [NotNullWhen(false)] out
DiagnosticInfo
? diagnostic)
309
diagnostic =
DiagnosticInfo
.Create(
326
private static bool TryGetGuid(INamedTypeSymbol interfaceSymbol, InterfaceDeclarationSyntax syntax, [NotNullWhen(true)] out Guid? guid, [NotNullWhen(false)] out
DiagnosticInfo
? diagnostic)
351
diagnostic =
DiagnosticInfo
.Create(
ComMethodInfo.cs (6)
66
private static
DiagnosticInfo
? GetDiagnosticIfInvalidMethodForGeneration(MethodDeclarationSyntax comMethodDeclaringSyntax, IMethodSymbol method)
74
return
DiagnosticInfo
.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, comMethodDeclaringSyntax.Identifier.GetLocation(), method.Name);
80
return
DiagnosticInfo
.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, comMethodDeclaringSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString());
119
return DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(
DiagnosticInfo
.Create(GeneratorDiagnostics.MethodNotDeclaredInAttributedInterface, method.Locations.FirstOrDefault(), method.ToDisplayString()));
135
return DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(
DiagnosticInfo
.Create(GeneratorDiagnostics.CannotAnalyzeMethodPattern, method.Locations.FirstOrDefault(), method.ToDisplayString()));
138
var
diag = GetDiagnosticIfInvalidMethodForGeneration(comMethodDeclaringSyntax, method);
Comparers.cs (4)
18
public static readonly IEqualityComparer<(MemberDeclarationSyntax Syntax, ImmutableArray<
DiagnosticInfo
> Diagnostics)> GeneratedSyntax = new CustomValueTupleElementComparer<MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>>(SyntaxEquivalentComparer.Instance, new ImmutableArraySequenceEqualComparer<
DiagnosticInfo
>(EqualityComparer<
DiagnosticInfo
>.Default));
GeneratedStubCodeContext.cs (1)
13
SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics) : GeneratedMethodContextBase(OriginalDefiningType, Diagnostics);
IncrementalMethodStubGenerationContext.cs (2)
10
internal abstract record GeneratedMethodContextBase(ManagedTypeInfo OriginalDefiningType, SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics);
23
SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics,
SkippedStubContext.cs (1)
9
internal sealed record SkippedStubContext(ManagedTypeInfo OriginalDefiningType) : GeneratedMethodContextBase(OriginalDefiningType, new(ImmutableArray<
DiagnosticInfo
>.Empty));
VirtualMethodPointerStubGenerator.cs (2)
23
public static (MethodDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateManagedToNativeStub(
130
public static (MethodDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateNativeToManagedStub(
VtableIndexStubGenerator.cs (5)
79
IncrementalValuesProvider<(MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>)> generateManagedToNativeStub = generateStubInformation
97
IncrementalValuesProvider<(MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>)> generateNativeToManagedStub = nativeToManagedStubContexts
320
new SequenceEqualImmutableArray<
DiagnosticInfo
>(generatorDiagnostics.Diagnostics.ToImmutableArray()),
365
private static (MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateManagedToNativeStub(
378
private static (MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateNativeToManagedStub(
Microsoft.Interop.JavaScript.JSImportGenerator (20)
Comparers.cs (8)
18
public static readonly IEqualityComparer<(MemberDeclarationSyntax Syntax, ImmutableArray<
DiagnosticInfo
> Diagnostics)> GeneratedSyntax = new CustomValueTupleElementComparer<MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>>(SyntaxEquivalentComparer.Instance, new ImmutableArraySequenceEqualComparer<
DiagnosticInfo
>(EqualityComparer<
DiagnosticInfo
>.Default));
19
public static readonly IEqualityComparer<(MemberDeclarationSyntax, StatementSyntax, AttributeListSyntax, ImmutableArray<
DiagnosticInfo
>)> GeneratedSyntax4 =
20
new CustomValueTupleElementComparer<MemberDeclarationSyntax, StatementSyntax, AttributeListSyntax, ImmutableArray<
DiagnosticInfo
>>(
22
new ImmutableArraySequenceEqualComparer<
DiagnosticInfo
>(EqualityComparer<
DiagnosticInfo
>.Default));
JSExportGenerator.cs (6)
27
SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics);
69
return ImmutableArray<
DiagnosticInfo
>.Empty;
72
return ImmutableArray.Create(
DiagnosticInfo
.Create(GeneratorDiagnostics.JSExportRequiresAllowUnsafeBlocks, null));
75
IncrementalValuesProvider<(MemberDeclarationSyntax, StatementSyntax, AttributeListSyntax, ImmutableArray<
DiagnosticInfo
>)> generateSingleStub = methodsToGenerate
214
new SequenceEqualImmutableArray<
DiagnosticInfo
>(generatorDiagnostics.Diagnostics.ToImmutableArray()));
305
private static (MemberDeclarationSyntax, StatementSyntax, AttributeListSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateSource(
JSImportGenerator.cs (6)
27
SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics);
67
return ImmutableArray<
DiagnosticInfo
>.Empty;
70
return ImmutableArray.Create(
DiagnosticInfo
.Create(GeneratorDiagnostics.JSImportRequiresAllowUnsafeBlocks, null));
73
IncrementalValuesProvider<(MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>)> generateSingleStub = methodsToGenerate
193
new SequenceEqualImmutableArray<
DiagnosticInfo
>(generatorDiagnostics.Diagnostics.ToImmutableArray()));
196
private static (MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateSource(
Microsoft.Interop.LibraryImportGenerator (16)
Comparers.cs (4)
18
public static readonly IEqualityComparer<(MemberDeclarationSyntax Syntax, ImmutableArray<
DiagnosticInfo
> Diagnostics)> GeneratedSyntax = new CustomValueTupleElementComparer<MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>>(SyntaxEquivalentComparer.Instance, new ImmutableArraySequenceEqualComparer<
DiagnosticInfo
>(EqualityComparer<
DiagnosticInfo
>.Default));
GeneratorDiagnostics.cs (1)
295
DiagnosticInfo
.Create(
LibraryImportGenerator.cs (11)
32
SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics);
56
DiagnosticInfo
? diagnostic = GetDiagnosticIfInvalidMethodForGeneration(data.Syntax, data.Symbol);
80
return ImmutableArray<
DiagnosticInfo
>.Empty;
83
return ImmutableArray.Create(
DiagnosticInfo
.Create(GeneratorDiagnostics.RequiresAllowUnsafeBlocks, null));
86
IncrementalValuesProvider<(MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>)> generateSingleStub = methodsToGenerate
322
new SequenceEqualImmutableArray<
DiagnosticInfo
>(generatorDiagnostics.Diagnostics.ToImmutableArray())
326
private static (MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateSource(
541
private static
DiagnosticInfo
? GetDiagnosticIfInvalidMethodForGeneration(MethodDeclarationSyntax methodSyntax, IMethodSymbol method)
550
return
DiagnosticInfo
.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name);
556
return
DiagnosticInfo
.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, nonPartialIdentifier);
562
return
DiagnosticInfo
.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, methodSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString());
Microsoft.Interop.LibraryImportGenerator.Downlevel (14)
Comparers.cs (4)
18
public static readonly IEqualityComparer<(MemberDeclarationSyntax Syntax, ImmutableArray<
DiagnosticInfo
> Diagnostics)> GeneratedSyntax = new CustomValueTupleElementComparer<MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>>(SyntaxEquivalentComparer.Instance, new ImmutableArraySequenceEqualComparer<
DiagnosticInfo
>(EqualityComparer<
DiagnosticInfo
>.Default));
DownlevelLibraryImportGenerator.cs (9)
31
SequenceEqualImmutableArray<
DiagnosticInfo
> Diagnostics);
55
DiagnosticInfo
? diagnostic = GetDiagnosticIfInvalidMethodForGeneration(data.Syntax, data.Symbol);
65
IncrementalValuesProvider<(MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>)> generateSingleStub = methodsToGenerate
227
new SequenceEqualImmutableArray<
DiagnosticInfo
>(generatorDiagnostics.Diagnostics.ToImmutableArray())
231
private static (MemberDeclarationSyntax, ImmutableArray<
DiagnosticInfo
>) GenerateSource(
411
private static
DiagnosticInfo
? GetDiagnosticIfInvalidMethodForGeneration(MethodDeclarationSyntax methodSyntax, IMethodSymbol method)
420
return
DiagnosticInfo
.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name);
426
return
DiagnosticInfo
.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, nonPartialIdentifier);
432
return
DiagnosticInfo
.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, methodSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString());
GeneratorDiagnostics.cs (1)
295
DiagnosticInfo
.Create(
Microsoft.Interop.SourceGeneration (45)
DiagnosticExtensions.cs (12)
116
public static
DiagnosticInfo
CreateDiagnosticInfo(
124
public static
DiagnosticInfo
CreateDiagnosticInfo(
133
public static
DiagnosticInfo
CreateDiagnosticInfo(
146
public static
DiagnosticInfo
CreateDiagnosticInfo(
160
public static
DiagnosticInfo
CreateDiagnosticInfo(
168
public static
DiagnosticInfo
CreateDiagnosticInfo(
192
DiagnosticInfo
.Create(descriptor, Location.None, properties: properties, args) :
193
DiagnosticInfo
.Create(descriptor, firstLocation, additionalLocations: additionalLocations, properties: properties, messageArgs: args);
196
public static
DiagnosticInfo
CreateDiagnosticInfo(
201
return
DiagnosticInfo
.Create(
207
public static
DiagnosticInfo
CreateDiagnosticInfo(
213
return
DiagnosticInfo
.Create(
DiagnosticInfo.cs (3)
26
public static
DiagnosticInfo
Create(DiagnosticDescriptor descriptor, Location location, params object?[] messageArgs)
38
public static
DiagnosticInfo
Create(DiagnosticDescriptor descriptor, Location location, ImmutableDictionary<string, string>? properties, params object?[] messageArgs)
50
public static
DiagnosticInfo
Create(DiagnosticDescriptor descriptor, Location location, IEnumerable<Location>? additionalLocations, ImmutableDictionary<string, string>? properties, params object?[] messageArgs)
DiagnosticOr.cs (14)
31
public abstract ImmutableArray<
DiagnosticInfo
> Diagnostics { get; }
35
private readonly SequenceEqualImmutableArray<
DiagnosticInfo
> _diagnostics;
36
internal Diag(ImmutableArray<
DiagnosticInfo
> diagnostics) => _diagnostics = diagnostics.ToSequenceEqual();
40
public override ImmutableArray<
DiagnosticInfo
> Diagnostics => _diagnostics.Array;
50
public override ImmutableArray<
DiagnosticInfo
> Diagnostics => throw new InvalidOperationException();
56
private readonly SequenceEqualImmutableArray<
DiagnosticInfo
> _diagnostics;
57
internal ValueAndDiagnostic(T value, ImmutableArray<
DiagnosticInfo
> diagnostics) => (_value, _diagnostics) = (value, diagnostics.ToSequenceEqual());
61
public override ImmutableArray<
DiagnosticInfo
> Diagnostics => _diagnostics.Array;
67
public DiagnosticOr<T> AddDiagnostic(
DiagnosticInfo
diagnostic) => this switch
89
public static DiagnosticOr<T> From(
DiagnosticInfo
diagnostic)
106
public static DiagnosticOr<T> From(T value, params
DiagnosticInfo
[] diagnostics)
119
public static (IncrementalValuesProvider<T>, IncrementalValuesProvider<
DiagnosticInfo
>) Split<T>(this IncrementalValuesProvider<DiagnosticOr<T>> provider)
129
public static (IncrementalValuesProvider<SequenceEqualImmutableArray<T>>, IncrementalValuesProvider<
DiagnosticInfo
>) SplitArrays<T>(this IncrementalValuesProvider<SequenceEqualImmutableArray<DiagnosticOr<T>>> provider)
139
public static (IncrementalValuesProvider<(T, T2)>, IncrementalValuesProvider<
DiagnosticInfo
>) Split<T, T2>(this IncrementalValuesProvider<(DiagnosticOr<T>, T2)> provider)
GeneratorDiagnosticsBag.cs (3)
22
private readonly List<
DiagnosticInfo
> _diagnostics = new();
23
public IEnumerable<
DiagnosticInfo
> Diagnostics => _diagnostics;
44
public void ReportDiagnostic(
DiagnosticInfo
diagnostic)
IncrementalGeneratorInitializationContextExtensions.cs (1)
53
public static void RegisterDiagnostics(this IncrementalGeneratorInitializationContext context, IncrementalValuesProvider<
DiagnosticInfo
> diagnostics)
Marshalling\GeneratorDiagnostic.cs (8)
26
public abstract
DiagnosticInfo
ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName);
35
public override
DiagnosticInfo
ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName)
39
return
DiagnosticInfo
.Create(descriptor, location, DiagnosticProperties, NotSupportedDetails, elementName);
41
return
DiagnosticInfo
.Create(descriptor, location, DiagnosticProperties, TypePositionInfo.ManagedType.DiagnosticFormattedName, elementName);
50
public override
DiagnosticInfo
ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName)
52
return
DiagnosticInfo
.Create(
68
public override
DiagnosticInfo
ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName)
70
return
DiagnosticInfo
.Create(
Marshalling\MarshallerHelpers.cs (2)
391
DiagnosticInfo
.Create(
401
DiagnosticInfo
.Create(
MethodSignatureDiagnosticLocations.cs (2)
42
DiagnosticInfo
CreateDiagnosticInfo(DiagnosticDescriptor descriptor, GeneratorDiagnostic diagnostic);
61
public
DiagnosticInfo
CreateDiagnosticInfo(DiagnosticDescriptor descriptor, GeneratorDiagnostic diagnostic)