You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In C#, if you create a signal, e.g. from Making your first 2D game:
[Signal]
public delegate void HitEventHandler();
and you emit the signal (same way the tutorial tells you):
EmitSignal(SignalName.Hit);
the SignalName.Hit will give you a compiler error in external IDE's like VS Code, since SignalName.Hit is not defined. However, note that the game will actually run and the signal will work fine in Godot.
I'd like to know if this could be fixed, or otherwise if there is a standard way to solve this problem. I believe a workaround for this issue is to use EmitSignal("nameString") instead of using EmitSignal(SignalName.xyz), however I chose to report this is overall as a bug because the EmitSignal documentation says "Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call", which makes me think this feature should be working fine.
Steps to reproduce
Open Mono Project, and create a C# script
Declare a signal like
[Signal]
public delegate void HitEventHandler();
then emit it somewhere like
EmitSignal(SignalName.Hit);
Observe that although Godot will not have a problem with this, IDE's will give a compiler error saying SignalName.Hit is not defined.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
This is a bug in the Microsoft C# extension for VSCode, their new Roslyn-based LSP doesn't support source generators. Switch back to Omnisharp or wait until they fix it.
This has been previously reported in godotengine/godot-csharp-vscode#57 which may contain more information. I'll be closing this issue since there's nothing we can do on our side.
Godot version
v4.1.1.stable.mono.official [bd6af8e]
System information
MacOS - Ventura 13.4.1
Issue description
In C#, if you create a signal, e.g. from Making your first 2D game:
and you emit the signal (same way the tutorial tells you):
the SignalName.Hit will give you a compiler error in external IDE's like VS Code, since SignalName.Hit is not defined. However, note that the game will actually run and the signal will work fine in Godot.
I'd like to know if this could be fixed, or otherwise if there is a standard way to solve this problem. I believe a workaround for this issue is to use EmitSignal("nameString") instead of using EmitSignal(SignalName.xyz), however I chose to report this is overall as a bug because the EmitSignal documentation says "Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call", which makes me think this feature should be working fine.
Steps to reproduce
then emit it somewhere like
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: