mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
* Spark features are enabled * Fixed as PR comments * minor change * PR comments fixed * minor fix * change constant name to avoid conflicts with sqlopsextension * sqlContext to context * Changed tab name to SQL Server Big Data Cluster * Added isCluster to ContextProvider to control display big data cluster dashboard tab Ported New/open Notebook code to mssql extension and enable them in dashboard * Fixed tslint
29 lines
958 B
TypeScript
29 lines
958 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
'use strict';
|
|
|
|
import * as vscode from 'vscode';
|
|
import { ApiWrapper } from './apiWrapper';
|
|
|
|
/**
|
|
* Global context for the application
|
|
*/
|
|
export class AppContext {
|
|
|
|
private serviceMap: Map<string, any> = new Map();
|
|
constructor(public readonly extensionContext: vscode.ExtensionContext, public readonly apiWrapper: ApiWrapper) {
|
|
this.apiWrapper = apiWrapper || new ApiWrapper();
|
|
}
|
|
|
|
public getService<T>(serviceName: string): T {
|
|
return this.serviceMap.get(serviceName) as T;
|
|
}
|
|
|
|
public registerService<T>(serviceName: string, service: T): void {
|
|
this.serviceMap.set(serviceName, service);
|
|
}
|
|
}
|