mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 11:32:13 +00:00
Merge pull request #98459 from zaevi/fix_csharp_signal_parameters
C#: Escape signal parameters
This commit is contained in:
commit
2705202ebb
@ -32,9 +32,9 @@ partial class EventSignals
|
||||
add => backing_MySignal += value;
|
||||
remove => backing_MySignal -= value;
|
||||
}
|
||||
protected void EmitSignalMySignal(string str, int num)
|
||||
protected void EmitSignalMySignal(string @str, int @num)
|
||||
{
|
||||
EmitSignal(SignalName.MySignal, str, num);
|
||||
EmitSignal(SignalName.MySignal, @str, @num);
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
|
||||
|
@ -295,7 +295,7 @@ namespace Godot.SourceGenerators
|
||||
for (int i = 0; i < paramCount; i++)
|
||||
{
|
||||
var paramSymbol = invokeMethodSymbol.Parameters[i];
|
||||
source.Append($"{paramSymbol.Type.FullQualifiedNameIncludeGlobal()} {paramSymbol.Name}");
|
||||
source.Append($"{paramSymbol.Type.FullQualifiedNameIncludeGlobal()} @{paramSymbol.Name}");
|
||||
if (i < paramCount - 1)
|
||||
{
|
||||
source.Append(", ");
|
||||
@ -310,11 +310,11 @@ namespace Godot.SourceGenerators
|
||||
if (paramSymbol.Type.TypeKind == TypeKind.Enum)
|
||||
{
|
||||
var underlyingType = ((INamedTypeSymbol)paramSymbol.Type).EnumUnderlyingType;
|
||||
source.Append($", ({underlyingType.FullQualifiedNameIncludeGlobal()}){paramSymbol.Name}");
|
||||
source.Append($", ({underlyingType.FullQualifiedNameIncludeGlobal()})@{paramSymbol.Name}");
|
||||
continue;
|
||||
}
|
||||
|
||||
source.Append($", {paramSymbol.Name}");
|
||||
source.Append($", @{paramSymbol.Name}");
|
||||
}
|
||||
source.Append(");\n");
|
||||
source.Append(" }\n");
|
||||
|
Loading…
Reference in New Issue
Block a user