提交 731ea1ef 编写于 作者: J Joao Moreno

git: report progress

上级 2caf36fd
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'use strict'; 'use strict';
import { Uri, EventEmitter, Event, SCMResource, SCMResourceDecorations, SCMResourceGroup, Disposable } from 'vscode'; import { Uri, EventEmitter, Event, SCMResource, SCMResourceDecorations, SCMResourceGroup, Disposable, window } from 'vscode';
import { Repository, IRef, IBranch, IRemote, IPushOptions } from './git'; import { Repository, IRef, IBranch, IRemote, IPushOptions } from './git';
import { throttle, anyEvent, eventToPromise, filterEvent, mapEvent } from './util'; import { throttle, anyEvent, eventToPromise, filterEvent, mapEvent } from './util';
import { watch } from './watch'; import { watch } from './watch';
...@@ -365,6 +365,7 @@ export class Model { ...@@ -365,6 +365,7 @@ export class Model {
} }
private async run(operation: Operation, fn: () => Promise<void> = () => Promise.resolve()): Promise<void> { private async run(operation: Operation, fn: () => Promise<void> = () => Promise.resolve()): Promise<void> {
window.withScmProgress(async () => {
this._operations = this._operations.start(operation); this._operations = this._operations.start(operation);
this._onRunOperation.fire(operation); this._onRunOperation.fire(operation);
...@@ -375,6 +376,7 @@ export class Model { ...@@ -375,6 +376,7 @@ export class Model {
this._operations = this._operations.end(operation); this._operations = this._operations.end(operation);
this._onDidRunOperation.fire(operation); this._onDidRunOperation.fire(operation);
} }
});
} }
@decorate(throttle) @decorate(throttle)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册