Add MustBeVariant attribute and analyzer

- MustBeVariant attribute can be used to enforce that generic types must
be a marshable from/to Variant.
- Also renames all diagnostic ids to be valid unicode identifiers.
This commit is contained in:
Raul Santos 2022-08-15 05:57:52 +02:00
parent d0a2a4c981
commit 6468f9b37c
No known key found for this signature in database
GPG key ID: B532473AE3A803E4
14 changed files with 227 additions and 18 deletions

View file

@ -177,6 +177,9 @@ namespace Godot.SourceGenerators
public static bool IsGodotSignalAttribute(this INamedTypeSymbol symbol)
=> symbol.ToString() == GodotClasses.SignalAttr;
public static bool IsGodotMustBeVariantAttribute(this INamedTypeSymbol symbol)
=> symbol.ToString() == GodotClasses.MustBeVariantAttr;
public static bool IsGodotClassNameAttribute(this INamedTypeSymbol symbol)
=> symbol.ToString() == GodotClasses.GodotClassNameAttr;