You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
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:
@@ -11,11 +11,11 @@ namespace Godot.SourceGenerators
|
||||
{
|
||||
public INamedTypeSymbol GodotObjectType { get; }
|
||||
|
||||
public TypeCache(GeneratorExecutionContext context)
|
||||
public TypeCache(Compilation compilation)
|
||||
{
|
||||
INamedTypeSymbol GetTypeByMetadataNameOrThrow(string fullyQualifiedMetadataName)
|
||||
{
|
||||
return context.Compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) ??
|
||||
return compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) ??
|
||||
throw new InvalidOperationException("Type not found: " + fullyQualifiedMetadataName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user