提交 3d0b9755 编写于 作者: J Joao Moreno

💥 scm state -> stateContextKey

上级 75576e3c
......@@ -23,7 +23,7 @@ export class GitSCMProvider implements SCMProvider {
get label(): string { return 'Git'; }
get state(): string {
get stateContextKey(): string {
switch (this.model.state) {
case State.Uninitialized: return 'uninitialized';
case State.Idle: return 'idle';
......
......@@ -704,7 +704,7 @@ declare module 'vscode' {
* A state identifier, which will be used to populate the value of the
* `scmProviderState` context key.
*/
readonly state?: string;
readonly stateContextKey?: string;
/**
* An [event](#Event) which should fire when any of the following attributes
......
......@@ -274,7 +274,7 @@ export type SCMRawResourceGroup = [
export abstract class MainThreadSCMShape {
$register(handle: number, features: SCMProviderFeatures): void { throw ni(); }
$unregister(handle: number): void { throw ni(); }
$onChange(handle: number, resources: SCMRawResourceGroup[], count: number | undefined, state: string | undefined): void { throw ni(); }
$onChange(handle: number, resources: SCMRawResourceGroup[], count: number | undefined, stateContextKey: string | undefined): void { throw ni(); }
$setInputBoxValue(value: string): void { throw ni(); }
}
......
......@@ -135,7 +135,7 @@ export class ExtHostSCM {
return [g.uri.toString(), g.contextKey, g.label, rawResources] as SCMRawResourceGroup;
});
this._proxy.$onChange(handle, rawResourceGroups, provider.count, provider.state);
this._proxy.$onChange(handle, rawResourceGroups, provider.count, provider.stateContextKey);
});
return new Disposable(() => {
......
......@@ -31,8 +31,8 @@ class MainThreadSCMProvider implements ISCMProvider {
private _count: number | undefined = undefined;
get count(): number | undefined { return this._count; }
private _state: string | undefined = undefined;
get state(): string | undefined { return this._state; }
private _stateContextKey: string | undefined = undefined;
get stateContextKey(): string | undefined { return this._stateContextKey; }
constructor(
private _handle: number,
......@@ -67,7 +67,7 @@ class MainThreadSCMProvider implements ISCMProvider {
// }
}
$onChange(rawResourceGroups: SCMRawResourceGroup[], count: number | undefined, state: string | undefined): void {
$onChange(rawResourceGroups: SCMRawResourceGroup[], count: number | undefined, stateContextKey: string | undefined): void {
this._resources = rawResourceGroups.map(rawGroup => {
const [uri, contextKey, label, rawResources] = rawGroup;
const resources: ISCMResource[] = [];
......@@ -95,7 +95,7 @@ class MainThreadSCMProvider implements ISCMProvider {
});
this._count = count;
this._state = state;
this._stateContextKey = stateContextKey;
this._onDidChange.fire(this.resources);
}
......
......@@ -43,7 +43,7 @@ export interface ISCMProvider extends IDisposable {
readonly resources: ISCMResourceGroup[];
readonly onDidChange: Event<ISCMResourceGroup[]>;
readonly count?: number;
readonly state?: string;
readonly stateContextKey?: string;
open(uri: ISCMResource): TPromise<void>;
getOriginalResource(uri: URI): TPromise<URI>;
......
......@@ -107,6 +107,6 @@ export class SCMService implements ISCMService {
}
private onDidChangeProviderState(): void {
this.activeProviderStateContextKey.set(this.activeProvider.state);
this.activeProviderStateContextKey.set(this.activeProvider.stateContextKey);
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册