wip: git init

This commit is contained in:
Joao Moreno
2017-02-15 17:46:58 +01:00
parent a7f80ccece
commit ac703e0d92
14 changed files with 168 additions and 78 deletions

View File

@@ -6,17 +6,31 @@
'use strict';
import { scm, Uri, Disposable, SCMProvider, SCMResourceGroup, Event, ProviderResult, workspace } from 'vscode';
import { Model, Resource, ResourceGroup } from './model';
import { Model, Resource, ResourceGroup, State } from './model';
import { CommandCenter } from './commands';
import { anyEvent, mapEvent } from './util';
export class GitSCMProvider implements SCMProvider {
private disposables: Disposable[] = [];
get resources(): SCMResourceGroup[] { return this.model.resources; }
get onDidChange(): Event<SCMResourceGroup[]> { return this.model.onDidChange; }
get onDidChange(): Event<SCMResourceGroup[]> {
return mapEvent(anyEvent<any>(this.model.onDidChange, this.model.onDidChangeState), () => this.model.resources);
}
get label(): string { return 'Git'; }
get state(): string {
switch (this.model.state) {
case State.Uninitialized: return 'uninitialized';
case State.Idle: return 'idle';
case State.NotAGitRepository: return 'norepo';
default: return '';
}
}
get count(): number {
const countBadge = workspace.getConfiguration('git').get<string>('countBadge');