mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
* Kusto extension * Add kusto to extensions.ts * Remove objectExplorerNodeProvider * Removed some BDC items + CR cleanup * Cleanup unused strings in package.nls.json * Remove unused svgs, and some cleanup * Bringing objectExplorerNode back and hygiene changes * rename to KustoObjectExplorerNodeProvider * rename to KustoIconProvider * Cleanup SQL code * Fix compilation error * Clean up in objectExplorerNodeProvider folder * Some more clean up based on comments * apiWrapper add * changed to camelCase * Remove unused functions/files * Removed AgentServicesFeature * dacfx, cms, schemacompare clean up * Clean up and addressed few comments * Remove apWrapper from kusto extension * Addressed few comments * credentialstore and escapeexception changes * Added strict check for Kusto extension * Fix error and addressed comment * Saving Kusto files shoulf default to .kql * package.json changes * Fix objectExplorerNodeProvider * Amir/kusto fix (#11972) * Add the compiled extensions.js * Fix strict compile rules Co-authored-by: Monica Gupta <mogupt@microsoft.com> Co-authored-by: Amir Omidi <amomidi@microsoft.com>
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
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';
|
|
|
|
/**
|
|
* Global context for the application
|
|
*/
|
|
export class AppContext {
|
|
|
|
private serviceMap: Map<string, any> = new Map();
|
|
|
|
constructor(public readonly extensionContext: vscode.ExtensionContext) { }
|
|
|
|
public getService<T>(serviceName: string): T | undefined {
|
|
const service = this.serviceMap.get(serviceName) as T;
|
|
if (!service) {
|
|
console.warn('Service ', serviceName, ' is not registered');
|
|
}
|
|
return service;
|
|
}
|
|
|
|
public registerService<T>(serviceName: string, service: T): void {
|
|
if (this.serviceMap.has(serviceName)) {
|
|
console.warn('Multiple services ', serviceName, ' registered!');
|
|
} else {
|
|
this.serviceMap.set(serviceName, service);
|
|
}
|
|
}
|
|
}
|