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
No known key found for this signature in database
GPG key ID: C12F69B0AD0390DD
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)
{