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