mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
git status through extension!
This commit is contained in:
@@ -53,9 +53,14 @@ export class GitSCMProvider implements SCMProvider {
|
||||
|
||||
private disposables: Disposable[] = [];
|
||||
|
||||
private _resources: SCMResourceGroup[] = [];
|
||||
get resources(): SCMResourceGroup[] { return this._resources; }
|
||||
|
||||
private _onDidChange = new EventEmitter<SCMResourceGroup[]>();
|
||||
get onDidChange(): Event<SCMResourceGroup[]> { return this._onDidChange.event; }
|
||||
|
||||
get label(): string { return 'Git'; }
|
||||
|
||||
constructor(private model: Model) {
|
||||
model.onDidChange(this.onModelChange, this, this.disposables);
|
||||
model.update(true);
|
||||
@@ -106,21 +111,22 @@ export class GitSCMProvider implements SCMProvider {
|
||||
}
|
||||
});
|
||||
|
||||
const groups: SCMResourceGroup[] = [];
|
||||
const resources: SCMResourceGroup[] = [];
|
||||
|
||||
if (merge.length > 0) {
|
||||
groups.push(new MergeGroup(merge));
|
||||
resources.push(new MergeGroup(merge));
|
||||
}
|
||||
|
||||
if (index.length > 0) {
|
||||
groups.push(new IndexGroup(index));
|
||||
resources.push(new IndexGroup(index));
|
||||
}
|
||||
|
||||
if (workingTree.length > 0) {
|
||||
groups.push(new WorkingTreeGroup(workingTree));
|
||||
resources.push(new WorkingTreeGroup(workingTree));
|
||||
}
|
||||
|
||||
this._onDidChange.fire(groups);
|
||||
this._resources = resources;
|
||||
this._onDidChange.fire(resources);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user