mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
vscode: eliminate floating promises and insane amount of resource handle leaks
This commit is contained in:
parent
8d0f7da2f5
commit
8153b60e1d
8 changed files with 34 additions and 19 deletions
|
@ -9,12 +9,14 @@ const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '
|
|||
export function activateStatusDisplay(ctx: Ctx) {
|
||||
const statusDisplay = new StatusDisplay(ctx.config.cargoWatchOptions.command);
|
||||
ctx.pushCleanup(statusDisplay);
|
||||
ctx.onDidRestart(client => {
|
||||
client.onProgress(WorkDoneProgress.type, 'rustAnalyzer/cargoWatcher', params => statusDisplay.handleProgressNotification(params));
|
||||
});
|
||||
ctx.onDidRestart(client => ctx.pushCleanup(client.onProgress(
|
||||
WorkDoneProgress.type,
|
||||
'rustAnalyzer/cargoWatcher',
|
||||
params => statusDisplay.handleProgressNotification(params)
|
||||
)));
|
||||
}
|
||||
|
||||
class StatusDisplay implements vscode.Disposable, Disposable {
|
||||
class StatusDisplay implements Disposable {
|
||||
packageName?: string;
|
||||
|
||||
private i: number = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue