mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 02:48:30 -05:00
* Introduced ApiWrapper for testability * Added tests for coverage of utils.ts * Addressed comments
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Disposable, ExtensionContext } from 'vscode';
|
|
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
|
|
import { ApiWrapper } from '../common/apiWrapper';
|
|
|
|
/**
|
|
* The main controller class that initializes the extension
|
|
*/
|
|
export default class MainController implements Disposable {
|
|
protected schemaCompareMainWindow: SchemaCompareMainWindow;
|
|
|
|
public constructor(private context: ExtensionContext, private apiWrapper: ApiWrapper) {
|
|
this.schemaCompareMainWindow = new SchemaCompareMainWindow(this.apiWrapper, null, this.extensionContext);
|
|
}
|
|
|
|
public get extensionContext(): ExtensionContext {
|
|
return this.context;
|
|
}
|
|
|
|
public deactivate(): void {
|
|
}
|
|
|
|
public activate(): Promise<boolean> {
|
|
this.initializeSchemaCompareDialog();
|
|
return Promise.resolve(true);
|
|
}
|
|
|
|
private initializeSchemaCompareDialog(): void {
|
|
this.apiWrapper.registerCommand('schemaCompare.start', (context: any) => this.schemaCompareMainWindow.start(context));
|
|
}
|
|
|
|
public dispose(): void {
|
|
this.deactivate();
|
|
}
|
|
}
|