godotengine / godot-vscode-plugin

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

Godot VSCode plugin throws nonexistent errors on top of file #522

Closed Excalizan closed 9 months ago

Excalizan commented 9 months ago

Godot version

v4.1.2.stable.mono.official [399c9dc39]

VS Code version

1.84.0

Godot Tools VS Code extension version

1.3.1

System information

Windows 10

Issue description

Godot VSCode extension is not behaving like I'd expect it to. It keeps throwing errors that read "Error (test)" on top of the file (@ line1:col1, the extends NODETYPE part) but my code works just fine when I run the project. It's also inconsistent since it doesn't throw the same error on my Player.gd file. I do not understand what is happening and I don't think it's related to my code, since this happens in every project I have in my folders, including premade games, etc. I have dropped images of the errors below. If you need any other resources such as screenshots or code I can drop them too.

Mainscene.gd: error1

Boulder.gd: error2

Player.gd: noerror

I should also note that I am having the same issue on Godot v4.1.2.stable.mono.official [399c9dc39] too.

Steps to reproduce

Just create a new project in Godot v4.1.2.stable.mono.official [399c9dc39] and make a basic 2D project that involves RigidBody2D's and CharacterBody2D's. I suppose you will see the same effect.

DaelonSuzuka commented 9 months ago

This is a problem with the language server, which is a part of the Godot engine. This extension does not generate any of these errors, it just displays the information the engine gives it.

Unfortunately, there isn't really anything I can do about this.

Excalizan commented 9 months ago

Alright, so what do I do now? Do I need to post this on the main repo?

DaelonSuzuka commented 9 months ago

Nothing, really. This issue has been known for years and has been reported everywhere many times.

Excalizan commented 9 months ago

Well, I kinda fixed it I guess, let me tell. There was a warning in the script saying the delta parameter in _physics_process was never used and advised me to prefix it with an underscore like _delta. No big deal, right? And I put the underscore in there to make the warning go away, and it just worked. I achieved the same effect by using the delta variable basically anywhere, it doesn't matter.

DaelonSuzuka commented 9 months ago

I hope that keeps working for you.