godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.52k stars 149 forks source link

Custom C# signal names are shown as compiler errors in Godot 4 #498

Closed fleetfoxx closed 11 months ago

fleetfoxx commented 11 months ago

Godot version

4.1.1.stable.mono

VS Code version

1.82.2

Godot Tools VS Code extension version

1.3.1

System information

Windows 11

Issue description

When using the custom signal syntax for C# described in the docs, the signal name is marked as a compiler error CS0117 "'Node.SignalName' does not contain a definition for 'MyCustomSignal'" despite compiling successfully in the editor.

image

Steps to reproduce

  1. Create a C# script containing a custom signal.
  2. Observe the compiler error.
using Godot;

public partial class GlobalSignals : Node
{
  [Signal] public delegate void SetCameraTargetEventHandler(Node3D target);

  public void EmitSetCameraTargetSignal(Node3D target)
  {
    EmitSignal(SignalName.SetCameraTarget, target);
  }
}
atirut-w commented 11 months ago

This extension only deal with GDScripts. The errors are coming from the C# extension, I'm afraid. I remember there's an option in Godot's tools menu to fix this, but I forgot how to do it.

fleetfoxx commented 11 months ago

Indeed it does. I had issues with syntax highlighting in Godot 3 that seemed to be resolved after I installed this extension. However, I can confirm syntax highlighting is still present after disabling this extension while using Godot 4. My mistake for attributing this issue to godot-tools. Thank you for the help, I'll look around for the option you mentioned.