Skip to content

Commit

Permalink
Log language server restart reasons (#2736)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Oct 18, 2024
1 parent bb336e5 commit 22cf699
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion vscode/src/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ export class Workspace implements WorkspaceInterface {
await this.ruby.activateRuby();
}

this.outputChannel.info(
"Restarting the Ruby LSP because configuration changed",
);
await this.restart();
}
}),
Expand All @@ -363,7 +366,12 @@ export class Workspace implements WorkspaceInterface {
new vscode.RelativePattern(this.workspaceFolder, pattern),
);

const debouncedRestart = debounce(this.restart.bind(this), 5000);
const debouncedRestart = debounce(async () => {
this.outputChannel.info(
`Restarting the Ruby LSP because ${pattern} changed`,
);
await this.restart();
}, 5000);

context.subscriptions.push(
watcher,
Expand All @@ -383,6 +391,9 @@ export class Workspace implements WorkspaceInterface {
};
const stop = async () => {
this.#inhibitRestart = false;
this.outputChannel.info(
`Restarting the Ruby LSP because ${glob} changed`,
);
await this.restart();
};

Expand Down

0 comments on commit 22cf699

Please sign in to comment.