Skip to content

stopLanguageServer() hangs, preventing Stop/Restart from working correctly #2

Closed
@xeger

Description

@xeger

Whenever I use the "Syntax Tree: Stop" command on my system, the await languageClient.stop() never returns. I've verified that the ruby process disappears from ps output, so it there's sort of unclean shutdown happening in the language server client (provided by VS Code).

After debugging, I isolated the root cause: the VS Code client expects a response to every RPC, including shutdown. The syntax_tree gem was abruptly terminating on shutdown requests without providing a response.

I have a proposed fix in the gem that responds to shutdown requests & verified this makes VS Code happy.

This fix reveals another issue: because Visualize registers a command every time it is constructed, VS Code throws an error if the language server is started a second time! It might be a bug for us to (re)register the command inside startLanguageServer -- we need a proxy command function that will forward to the most recently constructed instance of Visualize.

My goal is to be able to cleanly restart the language server -- because I want to add settings to the extension and ensure the LSP restarts when settings are tweaked; see #3. Seems like fixing the LSP in the gem is the first step to that, although I need to fix the command-reregistration issue too, if I'm going to make settings work.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions