mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user