未验证 提交 687131cb 编写于 作者: M Martin Aeschlimann 提交者: GitHub

Merge pull request #95778 from microsoft/aeschli/themeApiFinal

make API to access theme kind final
......@@ -5520,6 +5520,26 @@ declare module 'vscode' {
update(key: string, value: any): Thenable<void>;
}
/**
* 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.
*/
......@@ -7734,6 +7754,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<ColorTheme>;
}
/**
......
......@@ -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<ColorTheme>;
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/39441
export interface CompletionItem {
......
......@@ -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);
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册