🐛 git: don't wait for idle when git show

fixes #24213
This commit is contained in:
Joao Moreno
2017-04-10 15:37:36 +02:00
parent 15a2d69d1c
commit 2ab523ae7d
2 changed files with 8 additions and 11 deletions
+2 -5
View File
@@ -6,7 +6,7 @@
'use strict';
import { workspace, Uri, Disposable, Event, EventEmitter, window } from 'vscode';
import { debounce, throttle } from './decorators';
import { debounce } from './decorators';
import { fromGitUri } from './uri';
import { Model } from './model';
@@ -44,10 +44,7 @@ export class GitContentProvider {
this.fireChangeEvents();
}
@throttle
private async fireChangeEvents(): Promise<void> {
await this.model.whenIdle();
private fireChangeEvents(): void {
Object.keys(this.cache)
.forEach(key => this.onDidChangeEmitter.fire(this.cache[key].uri));
}
+6 -6
View File
@@ -365,12 +365,6 @@ export class Model implements Disposable {
this.status();
}
async whenIdle(): Promise<void> {
while (!this.operations.isIdle()) {
await eventToPromise(this.onDidRunOperation);
}
}
@throttle
async init(): Promise<void> {
if (this.state !== State.NotAGitRepository) {
@@ -685,6 +679,12 @@ export class Model implements Disposable {
await timeout(5000);
}
private async whenIdle(): Promise<void> {
while (!this.operations.isIdle()) {
await eventToPromise(this.onDidRunOperation);
}
}
dispose(): void {
this.repositoryDisposable.dispose();
this.disposables = dispose(this.disposables);