diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-08-15 05:57:52 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-08-25 01:47:40 +0200 |
commit | 6468f9b37c9605757593f9da2137da3ef756880e (patch) | |
tree | 0c4aec7e965d5f927c1b70bd2c7390ffab2df927 /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs | |
parent | d0a2a4c98195eb8a43713286b5b865dfbed05163 (diff) | |
download | redot-engine-6468f9b37c9605757593f9da2137da3ef756880e.tar.gz |
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.
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs index bac4708165..d868678179 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs @@ -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; |