Updated Generators
Removed un-nesscary Attribute generation, as now is part of core.
This commit is contained in:
parent
02d23935fa
commit
d96fbaf0e9
3 changed files with 8 additions and 54 deletions
|
|
@ -12,21 +12,8 @@ namespace Godot.Sharp.Extended.Generators;
|
|||
[Generator]
|
||||
public class NodeBindGenerator : IIncrementalGenerator
|
||||
{
|
||||
private const string AttributeSourceCode = """
|
||||
// <auto-generated />
|
||||
namespace Godot.Sharp.Extended.Generators;
|
||||
|
||||
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field)]
|
||||
public class NodeBindAttribute : Attribute
|
||||
{
|
||||
}
|
||||
""";
|
||||
public void Initialize(IncrementalGeneratorInitializationContext context)
|
||||
{
|
||||
context.RegisterPostInitializationOutput(ctx => ctx.AddSource(
|
||||
"NodeBindAttribute.g.cs",
|
||||
SourceText.From(AttributeSourceCode, Encoding.UTF8)));
|
||||
|
||||
var propertyProvider = context.SyntaxProvider
|
||||
.CreateSyntaxProvider(
|
||||
predicate: (s, _) => s is ClassDeclarationSyntax,
|
||||
|
|
@ -60,7 +47,7 @@ public class NodeBindGenerator : IIncrementalGenerator
|
|||
continue;
|
||||
|
||||
var attributeName = symbol.ContainingType.ToDisplayString();
|
||||
if (attributeName == $"Godot.Sharp.Extended.Generators.NodeBind")
|
||||
if (attributeName == $"Godot.Sharp.Extended.Attributes.NodeBind")
|
||||
return declarationSyntax;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue