godotengine / godot-vscode-plugin

Godot development tools for VSCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset connection attempts on successfull connect to a GDScript language server.

zarstensen opened this issue · comments

Godot version

4.2.1-stable

VS Code version

1.88.0

Godot Tools VS Code extension version

2.0.0

System information

windows 10

Problem statement

When developing tool scripts or addons for Godot, i often find my self reloading the Godot editor quite a lot.
This reload leads to a temporary disconnection to the language server in the godot-tools extension, which in of it self is not a problem.
The problem lies with the fact that the connection attempts do not reset when the godot-tools has connected to the reloaded godot editor again, which means i need to click the retry button on the couldn't connect dialog in vs code every dozen or so reloads, as the godot-tools extension has made too many connection attempts to the godot editor language server.

Proposed solution

Expose an option to reset the connection attempt count whenever a succesfull connection is made, as this makes sure many successive connections to a Godot language server doesn't eventually lead to a failure in the extension.

That's a good catch, thanks for reporting it. I've probably been experiencing this but I have a reflex to just reload VSCode when things get too wierd.

Expose an option

What's the option for? The current behavior is just wrong and the proposed behavior is correct.

Thanks for acting so quick on the issue :)
I proposed an option as i was not sure if this behavior was intended or if it was a bug, so you can just disregard that bit of the proposed solution.