mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Remove dacfx and schema compare from the azdata api (#6684)
* refactor mssql extension to directly expose dacfx and schema compare * remove more code * fix compile errors
This commit is contained in:
@@ -14,15 +14,24 @@ import { ApiWrapper } from './apiWrapper';
|
||||
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;
|
||||
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 {
|
||||
this.serviceMap.set(serviceName, service);
|
||||
if (this.serviceMap.has(serviceName)) {
|
||||
console.warn('Multiple services ', serviceName, ' registered!');
|
||||
} else {
|
||||
this.serviceMap.set(serviceName, service);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user