diff --git a/extensions/profiler/client/src/apiWrapper.ts b/extensions/profiler/client/src/apiWrapper.ts deleted file mode 100644 index a9eaa4577a..0000000000 --- a/extensions/profiler/client/src/apiWrapper.ts +++ /dev/null @@ -1,55 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as vscode from 'vscode'; -import * as data from 'azdata'; - -/** - * Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into - * this API from our code - */ -export class ApiWrapper { - // Data APIs - - public registerWebviewProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { - return data.dashboard.registerWebviewProvider(widgetId, handler); - } - - - public registerControlHostProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { - return data.dashboard.registerWebviewProvider(widgetId, handler); - } - - /** - * Get the configuration for a extensionName - * @param extensionName The string name of the extension to get the configuration for - * @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations - */ - public getConfiguration(extensionName: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration { - if (typeof resource === 'string') { - try { - resource = this.parseUri(resource); - } catch (e) { - resource = undefined; - } - } - return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); - } - - /** - * Parse uri - */ - public parseUri(uri: string): vscode.Uri { - return vscode.Uri.parse(uri); - } - - public showOpenDialog(options: vscode.OpenDialogOptions): Thenable { - return vscode.window.showOpenDialog(options); - } - - public showErrorMessage(message: string, ...items: string[]): Thenable { - return vscode.window.showErrorMessage(message, ...items); - } -} diff --git a/extensions/profiler/client/src/main.ts b/extensions/profiler/client/src/main.ts index 480b0cc335..27374550c5 100644 --- a/extensions/profiler/client/src/main.ts +++ b/extensions/profiler/client/src/main.ts @@ -5,12 +5,10 @@ import vscode = require('vscode'); import { MainController } from './mainController'; -import { ApiWrapper } from './apiWrapper'; export let controller: MainController; export function activate(context: vscode.ExtensionContext) { - let apiWrapper = new ApiWrapper(); - controller = new MainController(context, apiWrapper); + controller = new MainController(context); controller.activate(); } diff --git a/extensions/profiler/client/src/mainController.ts b/extensions/profiler/client/src/mainController.ts index 3fa783a544..25e4f0c25d 100644 --- a/extensions/profiler/client/src/mainController.ts +++ b/extensions/profiler/client/src/mainController.ts @@ -5,19 +5,16 @@ import * as vscode from 'vscode'; import * as azdata from 'azdata'; -import { ApiWrapper } from './apiWrapper'; import { CreateSessionDialog } from './dialogs/profilerCreateSessionDialog'; /** * The main controller class that initializes the extension */ export class MainController { - protected _apiWrapper: ApiWrapper; protected _context: vscode.ExtensionContext; // PUBLIC METHODS - public constructor(context: vscode.ExtensionContext, apiWrapper?: ApiWrapper) { - this._apiWrapper = apiWrapper || new ApiWrapper(); + public constructor(context: vscode.ExtensionContext) { this._context = context; }