1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix extraction of C# default property values when negative

This commit is contained in:
Paul Joannon
2025-04-13 17:57:20 +02:00
parent 215acd52e8
commit 88191b0b15
5 changed files with 11 additions and 4 deletions

View File

@@ -430,6 +430,13 @@ namespace Godot.SourceGenerators
return true;
}
// Handle negative literals (e.g., `-10`)
if (expression is PrefixUnaryExpressionSyntax { Operand: LiteralExpressionSyntax } &&
expression.Kind() == SyntaxKind.UnaryMinusExpression)
{
return true;
}
// Handle identifiers (e.g., variable names)
if (expression is IdentifierNameSyntax identifier)
{