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

Restart the server in Error Handler Close event #19

Open
dead8309 opened this issue Mar 12, 2025 · 0 comments · May be fixed by #20
Open

Restart the server in Error Handler Close event #19

dead8309 opened this issue Mar 12, 2025 · 0 comments · May be fixed by #20

Comments

@dead8309
Copy link

The extension currently does not restart the lsp when the connection closes (e.g., due to a crash). This could be enhanced with either retrying atleast once or giving users the option to configure max-retries.

{
  ...
    "configuration": {
      "properties": {
        "sprocket.server.maxRetries": {
          "type": "number",
          "default": 1,
          "description": "Maximum number of times to attempt restarting the Sprocket server after termination."
        },
      }
    }
  ...
}

We can add a initializationFailedHandler to verify if sprocket was initialized or not and attempt to restart the lsp based on that

let initializationError;
let clientOptions = {
    documentSelector: [{ scheme: "file", language: "wdl" }],
    outputChannel: channel,
    initializationFailedHandler: (error: ResponseError<InitializeError> | Error | any) => {
      initializationError = error;
      return false;
    },
   // options
}
@dead8309 dead8309 linked a pull request Mar 12, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant