mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge from master
This commit is contained in:
@@ -2,14 +2,12 @@
|
||||
* 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 { Event } from 'vs/base/common/event';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import URI from 'vs/base/common/uri';
|
||||
|
||||
export interface IExtensionDescription {
|
||||
readonly id: string;
|
||||
@@ -37,6 +35,17 @@ export interface IExtensionDescription {
|
||||
enableProposedApi?: boolean;
|
||||
}
|
||||
|
||||
export const nullExtensionDescription = Object.freeze(<IExtensionDescription>{
|
||||
id: 'nullExtensionDescription',
|
||||
name: 'Null Extension Description',
|
||||
version: '0.0.0',
|
||||
publisher: 'vscode',
|
||||
enableProposedApi: false,
|
||||
engines: { vscode: '' },
|
||||
extensionLocation: URI.parse('void:location'),
|
||||
isBuiltin: false,
|
||||
});
|
||||
|
||||
export const IExtensionService = createDecorator<IExtensionService>('extensionService');
|
||||
|
||||
export interface IMessage {
|
||||
@@ -118,7 +127,19 @@ export class ExtensionPointContribution<T> {
|
||||
}
|
||||
}
|
||||
|
||||
export interface IExtensionService {
|
||||
export const ExtensionHostLogFileName = 'exthost';
|
||||
|
||||
export interface IWillActivateEvent {
|
||||
readonly event: string;
|
||||
readonly activation: Thenable<void>;
|
||||
}
|
||||
|
||||
export interface IResponsiveStateChangeEvent {
|
||||
target: ICpuProfilerTarget;
|
||||
isResponsive: boolean;
|
||||
}
|
||||
|
||||
export interface IExtensionService extends ICpuProfilerTarget {
|
||||
_serviceBrand: any;
|
||||
|
||||
/**
|
||||
@@ -137,26 +158,43 @@ export interface IExtensionService {
|
||||
*/
|
||||
onDidChangeExtensionsStatus: Event<string[]>;
|
||||
|
||||
/**
|
||||
* An event that is fired when activation happens.
|
||||
*/
|
||||
onWillActivateByEvent: Event<IWillActivateEvent>;
|
||||
|
||||
/**
|
||||
* An event that is fired when an extension host changes its
|
||||
* responsive-state.
|
||||
*/
|
||||
onDidChangeResponsiveChange: Event<IResponsiveStateChangeEvent>;
|
||||
|
||||
/**
|
||||
* Send an activation event and activate interested extensions.
|
||||
*/
|
||||
activateByEvent(activationEvent: string): TPromise<void>;
|
||||
activateByEvent(activationEvent: string): Thenable<void>;
|
||||
|
||||
/**
|
||||
* An promise that resolves when the installed extensions are registered after
|
||||
* their extension points got handled.
|
||||
*/
|
||||
whenInstalledExtensionsRegistered(): TPromise<boolean>;
|
||||
whenInstalledExtensionsRegistered(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Return all registered extensions
|
||||
*/
|
||||
getExtensions(): TPromise<IExtensionDescription[]>;
|
||||
getExtensions(): Promise<IExtensionDescription[]>;
|
||||
|
||||
/**
|
||||
* Return a specific extension
|
||||
* @param id An extension id
|
||||
*/
|
||||
getExtension(id: string): Promise<IExtensionDescription | undefined>;
|
||||
|
||||
/**
|
||||
* Read all contributions to an extension point.
|
||||
*/
|
||||
readExtensionPointContributions<T>(extPoint: IExtensionPoint<T>): TPromise<ExtensionPointContribution<T>[]>;
|
||||
readExtensionPointContributions<T>(extPoint: IExtensionPoint<T>): Promise<ExtensionPointContribution<T>[]>;
|
||||
|
||||
/**
|
||||
* Get information about extensions status.
|
||||
@@ -164,14 +202,9 @@ export interface IExtensionService {
|
||||
getExtensionsStatus(): { [id: string]: IExtensionsStatus };
|
||||
|
||||
/**
|
||||
* Check if the extension host can be profiled.
|
||||
* Return the inspect port or 0.
|
||||
*/
|
||||
canProfileExtensionHost(): boolean;
|
||||
|
||||
/**
|
||||
* Begin an extension host process profile session.
|
||||
*/
|
||||
startExtensionHostProfile(): TPromise<ProfileSession>;
|
||||
getInspectPort(): number;
|
||||
|
||||
/**
|
||||
* Restarts the extension host.
|
||||
@@ -189,6 +222,29 @@ export interface IExtensionService {
|
||||
stopExtensionHost(): void;
|
||||
}
|
||||
|
||||
export interface ProfileSession {
|
||||
stop(): TPromise<IExtensionHostProfile>;
|
||||
export interface ICpuProfilerTarget {
|
||||
|
||||
/**
|
||||
* Check if the extension host can be profiled.
|
||||
*/
|
||||
canProfileExtensionHost(): boolean;
|
||||
|
||||
/**
|
||||
* Begin an extension host process profile session.
|
||||
*/
|
||||
startExtensionHostProfile(): Promise<ProfileSession>;
|
||||
}
|
||||
|
||||
export interface ProfileSession {
|
||||
stop(): Promise<IExtensionHostProfile>;
|
||||
}
|
||||
|
||||
export function checkProposedApiEnabled(extension: IExtensionDescription): void {
|
||||
if (!extension.enableProposedApi) {
|
||||
throwProposedApiError(extension);
|
||||
}
|
||||
}
|
||||
|
||||
export function throwProposedApiError(extension: IExtensionDescription): never {
|
||||
throw new Error(`[${extension.id}]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ${extension.id}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user