Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically restart the language server or try to reconnect when needed #27

Open
NathanLovato opened this issue Aug 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@NathanLovato
Copy link
Contributor

Currently, when the language server will not connect, because Godot is not launched, or because Godot was closed, there is no information to the user, and the extension will not try to reconnect automatically.

We should see if there are hooks in zed that would allow us to try to reconnect automatically.

A separate improvement would be to inform the user when the server disconnected, although I don't know if Zed currently has a provision for this.

@NathanLovato NathanLovato added the enhancement New feature or request label Aug 15, 2024
@moomerman
Copy link
Contributor

moomerman commented Aug 24, 2024

I attempted implementing this by writing a go binary that replaces netcat and has support for reconnecting.

It all seemed to work fine, detecting that Godot had restarted for example and reconnecting except on reconnect it seems that Zed was dropping the connection which caused it to keep restarting all the time.

It seems to work find in terms of reconnecting now, but it looks like the context for the LSP needs to be sent again after reconnecting.

Maybe this won't be possible until Zed extensions support reconnecting directly.

@NathanLovato
Copy link
Contributor Author

Thanks for looking into this! I looked at the API provided by Zed only briefly. To me, this is something that needs to be handled from the code editor: ideally, we would offer to spawn a Godot process directly from Zed if needed, and detect and warn the user when the server disconnects (e.g. because the Godot editor was restarted or closed), all from Zed.

I don't know yet if this is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants