mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
* move handling generated files to the serilization classes * remove unneeded methods * add more folders to strictire compile, add more strict compile options * update ci * wip * add more layering and fix issues * add more strictness * remove unnecessary assertion * add missing checks * fix indentation * wip * remove jsdoc * fix layering * fix compile * fix compile errors * wip * wip * finish layering * fix css * more layering * rip * reworking results serializer * move some files around * move capabilities to platform wip * implement capabilities register provider * fix capabilities service * fix usage of the regist4ry * add contribution * remove no longer good parts * fix issues with startup * another try * fix startup * fix imports * fix tests * fix tests * fix more tests * fix tests * fix more tests * fix broken test * fix tabbing * fix naming
69 lines
2.0 KiB
TypeScript
69 lines
2.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.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as azdata from 'azdata';
|
|
|
|
import { Event } from 'vs/base/common/event';
|
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
|
import type { IDisposable } from 'vs/base/common/lifecycle';
|
|
|
|
export const SERVICE_ID = 'capabilitiesService';
|
|
export const HOST_NAME = 'azdata';
|
|
export const HOST_VERSION = '1.0';
|
|
|
|
export const clientCapabilities = {
|
|
hostName: HOST_NAME,
|
|
hostVersion: HOST_VERSION
|
|
};
|
|
|
|
export interface ConnectionProviderProperties {
|
|
providerId: string;
|
|
displayName: string;
|
|
azureResource?: string;
|
|
connectionOptions: azdata.ConnectionOption[];
|
|
}
|
|
|
|
export interface ProviderFeatures {
|
|
connection: ConnectionProviderProperties;
|
|
}
|
|
|
|
|
|
export const ICapabilitiesService = createDecorator<ICapabilitiesService>(SERVICE_ID);
|
|
|
|
/**
|
|
* Interface for managing provider capabilities
|
|
*/
|
|
export interface ICapabilitiesService {
|
|
_serviceBrand: undefined;
|
|
|
|
/**
|
|
* Retrieve a list of registered capabilities providers
|
|
*/
|
|
getCapabilities(provider: string): ProviderFeatures | undefined;
|
|
|
|
/**
|
|
* get the old version of provider information
|
|
*/
|
|
getLegacyCapabilities(provider: string): azdata.DataProtocolServerCapabilities | undefined;
|
|
|
|
/**
|
|
* Register a capabilities provider
|
|
*/
|
|
registerProvider(provider: azdata.CapabilitiesProvider): void;
|
|
|
|
/**
|
|
* When new capabilities are registered, it emits the @see ProviderFeatures, which can be used to get the new capabilities
|
|
*/
|
|
readonly onCapabilitiesRegistered: Event<{ id: string; features: ProviderFeatures }>;
|
|
|
|
/**
|
|
* Get an array of all known providers
|
|
*/
|
|
readonly providers: { [id: string]: ProviderFeatures };
|
|
|
|
registerConnectionProvider(id: string, properties: ConnectionProviderProperties): IDisposable;
|
|
|
|
}
|