git: give up on using the editor

fixes #20983
This commit is contained in:
Joao Moreno
2017-02-21 11:55:21 +01:00
parent 6595091690
commit ca1deee166
13 changed files with 112 additions and 201 deletions

View File

@@ -245,6 +245,7 @@ export abstract class MainProcessExtensionServiceShape {
export interface SCMProviderFeatures {
label: string;
supportsOpen: boolean;
supportsAcceptChanges: boolean;
supportsDrag: boolean;
supportsOriginalResource: boolean;
}
@@ -394,6 +395,7 @@ export abstract class ExtHostTerminalServiceShape {
export abstract class ExtHostSCMShape {
$open(id: string, resourceGroupId: string, uri: string): TPromise<void> { throw ni(); }
$acceptChanges(id: string): TPromise<void> { throw ni(); }
$drag(id: string, fromResourceGroupId: string, fromUri: string, toResourceGroupId: string): TPromise<void> { throw ni(); }
$getOriginalResource(id: string, uri: URI): TPromise<URI> { throw ni(); }
$onInputBoxValueChange(value: string): TPromise<void> { throw ni(); }

View File

@@ -152,6 +152,7 @@ export class ExtHostSCM {
this._proxy.$register(providerId, {
label: provider.label,
supportsOpen: !!provider.open,
supportsAcceptChanges: !!provider.acceptChanges,
supportsDrag: !!provider.drag,
supportsOriginalResource: !!provider.getOriginalResource
});
@@ -217,6 +218,16 @@ export class ExtHostSCM {
return asWinJsPromise(token => provider.open(resource, token));
}
$acceptChanges(providerId: string): TPromise<void> {
const provider = this._providers[providerId];
if (!provider) {
return TPromise.as(null);
}
return asWinJsPromise(token => provider.acceptChanges(token));
}
$drag(providerId: string, fromResourceGroupId: string, fromUri: string, toResourceGroupId: string): TPromise<void> {
const provider = this._providers[providerId];

View File

@@ -52,6 +52,14 @@ class MainThreadSCMProvider implements ISCMProvider {
return this.proxy.$open(this.id, resource.resourceGroupId, resource.uri.toString());
}
acceptChanges(): TPromise<void> {
if (!this.features.supportsAcceptChanges) {
return TPromise.as(null);
}
return this.proxy.$acceptChanges(this.id);
}
drag(from: ISCMResource, to: ISCMResourceGroup): TPromise<void> {
if (!this.features.supportsDrag) {
return TPromise.as(null);
@@ -125,8 +133,8 @@ export class MainThreadSCM extends MainThreadSCMShape {
super();
this.proxy = threadService.get(ExtHostContext.ExtHostSCM);
this.inputBoxListener = this.scmService.inputBoxModel.onDidChangeContent(e => {
this.proxy.$onInputBoxValueChange(this.scmService.inputBoxModel.getValue());
this.inputBoxListener = this.scmService.input.onDidChange(value => {
this.proxy.$onInputBoxValueChange(value);
});
}
@@ -156,7 +164,7 @@ export class MainThreadSCM extends MainThreadSCMShape {
}
$setInputBoxValue(value: string): void {
this.scmService.inputBoxModel.setValue(value);
this.scmService.input.value = value;
}
dispose(): void {