diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2022-12-30 01:29:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-30 01:29:53 +0100 |
commit | 0daa86d70e7338506c37bee6b6e0c4aba7255d68 (patch) | |
tree | 56183030d38d6893fd661dabe5c6495412c06a4e /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs | |
parent | a75493091823020d858fabadbfa5994da0d658cb (diff) | |
parent | a43e8285a7df01edd5a1fb523ca91c233fa1f5b8 (diff) | |
download | redot-engine-0daa86d70e7338506c37bee6b6e0c4aba7255d68.tar.gz |
Merge pull request #70511 from raulsntos/dotnet/fix-update-script-class-info
C#: Skip getting class info for unbound generics
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs index fb32f6192f..eae7e41da8 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs @@ -45,8 +45,11 @@ namespace Godot.SourceGenerators return false; }) ) - // Ignore classes whose name is not the same as the file name - .Where(x => Path.GetFileNameWithoutExtension(x.cds.SyntaxTree.FilePath) == x.symbol.Name) + .Where(x => + // Ignore classes whose name is not the same as the file name + Path.GetFileNameWithoutExtension(x.cds.SyntaxTree.FilePath) == x.symbol.Name && + // Ignore generic classes + !x.symbol.IsGenericType) .GroupBy(x => x.symbol) .ToDictionary(g => g.Key, g => g.Select(x => x.cds)); @@ -150,8 +153,6 @@ namespace Godot.SourceGenerators first = false; sourceBuilder.Append("typeof("); sourceBuilder.Append(qualifiedName); - if (godotClass.Key.IsGenericType) - sourceBuilder.Append($"<{new string(',', godotClass.Key.TypeParameters.Count() - 1)}>"); sourceBuilder.Append(")"); } |