From af44ead34cb412c0db254e4bc2d01f126cdb700a Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 21 Apr 2020 16:39:06 +0200 Subject: [PATCH] make theme API final --- src/vs/vscode.d.ts | 31 +++++++++++++++ src/vs/vscode.proposed.d.ts | 38 ------------------- .../workbench/api/common/extHost.api.impl.ts | 2 - 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 284ca395dc8..731da1af381 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5511,6 +5511,26 @@ declare module 'vscode' { update(key: string, value: any): Thenable; } + /** + * Represents a color theme kind. + */ + export enum ColorThemeKind { + Light = 1, + Dark = 2, + HighContrast = 3 + } + + /** + * Represents a color theme. + */ + export interface ColorTheme { + + /** + * The kind of this color theme: light, dark or high contrast. + */ + readonly kind: ColorThemeKind; + } + /** * Controls the behaviour of the terminal's visibility. */ @@ -7725,6 +7745,17 @@ declare module 'vscode' { * @return Disposable that unregisters the provider. */ export function registerCustomEditorProvider(viewType: string, provider: CustomTextEditorProvider, options?: { readonly webviewOptions?: WebviewPanelOptions; }): Disposable; + + /** + * The currently active color theme as configured in the settings. The active + * theme can be changed via the `workbench.colorTheme` setting. + */ + export let activeColorTheme: ColorTheme; + + /** + * An [event](#Event) which fires when the active color theme is changed or has changes. + */ + export const onDidChangeActiveColorTheme: Event; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index b8bc3807e7d..e6c57882e06 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1764,44 +1764,6 @@ declare module 'vscode' { //#endregion - //#region color theme access - - /** - * Represents a color theme kind. - */ - export enum ColorThemeKind { - Light = 1, - Dark = 2, - HighContrast = 3 - } - - /** - * Represents a color theme. - */ - export interface ColorTheme { - - /** - * The kind of this color theme: light, dark or high contrast. - */ - readonly kind: ColorThemeKind; - } - - export namespace window { - /** - * The currently active color theme as configured in the settings. The active - * theme can be changed via the `workbench.colorTheme` setting. - */ - export let activeColorTheme: ColorTheme; - - /** - * An [event](#Event) which fires when the active theme changes or one of it's colors chnage. - */ - export const onDidChangeActiveColorTheme: Event; - } - - //#endregion - - //#region https://github.com/microsoft/vscode/issues/39441 export interface CompletionItem { diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index bb7efbed94d..4a574b68daa 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -604,11 +604,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostQuickOpen.createInputBox(extension.identifier); }, get activeColorTheme(): vscode.ColorTheme { - checkProposedApiEnabled(extension); return extHostTheming.activeColorTheme; }, onDidChangeActiveColorTheme(listener, thisArg?, disposables?) { - checkProposedApiEnabled(extension); return extHostTheming.onDidChangeActiveColorTheme(listener, thisArg, disposables); } };