Schema Compare extension (#4974)

* extension now working

* fix diff editor title disappearing and remove border from source and target name boxes

* redoing a bunch of stuff that disappeared after rebasing

* add images and add to extensions.ts

* moving a few changes to the right place after rebase

* formatting

* update toolbar svgs

* addressing comments

* add return types

* Adding PR comments

* Adding light and dark theme icons

* Fixing the diff editor title for dark theme
This commit is contained in:
kisantia
2019-04-17 19:14:22 -07:00
committed by udeeshagautam
parent 910e4815fa
commit d3483afaed
37 changed files with 1359 additions and 6 deletions

View File

@@ -167,6 +167,12 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
return rt;
}
$registerSchemaCompareServiceProvider(provider: azdata.SchemaCompareServicesProvider): vscode.Disposable {
let rt = this.registerProvider(provider, DataProviderType.SchemaCompareServicesProvider);
this._proxy.$registerSchemaCompareServicesProvider(provider.providerId, provider.handle);
return rt;
}
// Capabilities Discovery handlers
$getServerCapabilities(handle: number, client: azdata.DataProtocolClientCapabilities): Thenable<azdata.DataProtocolServerCapabilities> {
return this._resolveProvider<azdata.CapabilitiesProvider>(handle).getServerCapabilities(client);

View File

@@ -26,6 +26,7 @@ import { ISerializationService } from 'sql/platform/serialization/common/seriali
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IDacFxService } from 'sql/platform/dacfx/common/dacFxService';
import { ISchemaCompareService } from 'sql/platform/schemaCompare/common/schemaCompareService';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
/**
@@ -57,6 +58,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
@ISerializationService private _serializationService: ISerializationService,
@IFileBrowserService private _fileBrowserService: IFileBrowserService,
@IDacFxService private _dacFxService: IDacFxService,
@ISchemaCompareService private _schemaCompareService: ISchemaCompareService,
) {
if (extHostContext) {
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostDataProtocol);
@@ -453,6 +455,20 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
return undefined;
}
public $registerSchemaCompareServicesProvider(providerId: string, handle: number): Promise<any> {
const self = this;
this._schemaCompareService.registerProvider(providerId, <azdata.SchemaCompareServicesProvider>{
schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> {
return self._proxy.$schemaCompare(handle, sourceEndpointInfo, targetEndpointInfo, taskExecutionMode);
},
schemaCompareGenerateScript(operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
return self._proxy.$schemaCompareGenerateScript(handle, operationId, targetDatabaseName, scriptFilePath, taskExecutionMode);
}
});
return undefined;
}
// Connection Management handlers
public $onConnectionComplete(handle: number, connectionInfoSummary: azdata.ConnectionInfoSummary): void {
this._connectionManagementService.onConnectionComplete(handle, connectionInfoSummary);

View File

@@ -354,6 +354,10 @@ export function createApiFactory(
return extHostDataProvider.$registerDacFxServiceProvider(provider);
};
let registerSchemaCompareServicesProvider = (provider: azdata.SchemaCompareServicesProvider): vscode.Disposable => {
return extHostDataProvider.$registerSchemaCompareServiceProvider(provider);
};
// namespace: dataprotocol
const dataprotocol: typeof azdata.dataprotocol = {
registerBackupProvider,
@@ -371,6 +375,7 @@ export function createApiFactory(
registerAgentServicesProvider,
registerCapabilitiesServiceProvider,
registerDacFxServicesProvider,
registerSchemaCompareServicesProvider,
onDidChangeLanguageFlavor(listener: (e: azdata.DidChangeLanguageFlavorParams) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) {
return extHostDataProvider.onDidChangeLanguageFlavor(listener, thisArgs, disposables);
},
@@ -528,7 +533,10 @@ export function createApiFactory(
nb: nb,
AzureResource: sqlExtHostTypes.AzureResource,
TreeItem: sqlExtHostTypes.TreeItem,
extensions: extensions
extensions: extensions,
SchemaUpdateAction: sqlExtHostTypes.SchemaUpdateAction,
SchemaDifferenceType: sqlExtHostTypes.SchemaDifferenceType,
SchemaCompareEndpointType: sqlExtHostTypes.SchemaCompareEndpointType
};
},
@@ -754,6 +762,7 @@ export function createApiFactory(
return extHostDataProvider.$registerDacFxServiceProvider(provider);
};
// namespace: dataprotocol
const dataprotocol: typeof sqlops.dataprotocol = {
registerBackupProvider,

View File

@@ -455,6 +455,15 @@ export abstract class ExtHostDataProtocolShape {
*/
$generateDeployPlan(handle: number, packageFilePath: string, databaseName: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.GenerateDeployPlanResult> { throw ni(); }
/**
* Schema compare
*/
$schemaCompare(handle: number, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> { throw ni(); }
/**
* Schema compare generate script
*/
$schemaCompareGenerateScript(handle: number, operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> { throw ni(); }
}
/**
@@ -524,6 +533,7 @@ export interface MainThreadDataProtocolShape extends IDisposable {
$registerAdminServicesProvider(providerId: string, handle: number): Promise<any>;
$registerAgentServicesProvider(providerId: string, handle: number): Promise<any>;
$registerDacFxServicesProvider(providerId: string, handle: number): Promise<any>;
$registerSchemaCompareServicesProvider(providerId: string, handle: number): Promise<any>;
$unregisterProvider(handle: number): Promise<any>;
$onConnectionComplete(handle: number, connectionInfoSummary: azdata.ConnectionInfoSummary): void;
$onIntelliSenseCacheComplete(handle: number, connectionUri: string): void;