mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
wip: git init
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user