Simplify startup

This commit is contained in:
Aleksey Kladov 2020-02-17 13:40:20 +01:00
parent dcdbbddd16
commit d24e612106
5 changed files with 25 additions and 33 deletions

View file

@ -9,11 +9,14 @@ const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '
export function activateStatusDisplay(ctx: Ctx) {
const statusDisplay = new StatusDisplay(ctx.config.cargoWatchOptions.command);
ctx.pushCleanup(statusDisplay);
ctx.onStart(client => ctx.pushCleanup(client.onProgress(
WorkDoneProgress.type,
'rustAnalyzer/cargoWatcher',
params => statusDisplay.handleProgressNotification(params)
)));
const client = ctx.client;
if (client != null) {
ctx.pushCleanup(client.onProgress(
WorkDoneProgress.type,
'rustAnalyzer/cargoWatcher',
params => statusDisplay.handleProgressNotification(params)
))
}
}
class StatusDisplay implements Disposable {