API: Finalize env.uiKind (fixes #82883)

This commit is contained in:
Benjamin Pasero
2019-10-21 18:31:37 +02:00
parent ed31ffc1b5
commit 62ea960353
3 changed files with 23 additions and 31 deletions
+23
View File
@@ -6177,6 +6177,22 @@ declare module 'vscode' {
writeText(value: string): Thenable<void>;
}
/**
* Possible kinds of UI that can use extensions.
*/
export enum UIKind {
/**
* Extensions are accessed from a desktop application.
*/
Desktop = 1,
/**
* Extensions are accessed from a web browser.
*/
Web = 2
}
/**
* Namespace describing the environment the editor runs in.
*/
@@ -6235,6 +6251,13 @@ declare module 'vscode' {
*/
export const shell: string;
/**
* The UI kind property indicates from which UI extensions
* are accessed from. For example, extensions could be accessed
* from a desktop application or a web browser.
*/
export const uiKind: UIKind;
/**
* Opens an *external* item, e.g. a http(s) or mailto-link, using the
* default application.
-30
View File
@@ -1039,36 +1039,6 @@ declare module 'vscode' {
//#endregion
// #region Ben - UIKind
/**
* Possible kinds of UI that can use extensions.
*/
export enum UIKind {
/**
* Extensions are accessed from a desktop application.
*/
Desktop = 1,
/**
* Extensions are accessed from a web browser.
*/
Web = 2
}
export namespace env {
/**
* The UI kind property indicates from which UI extensions
* are accessed from. For example, extensions could be accessed
* from a desktop application or a web browser.
*/
export const uiKind: UIKind;
}
//#endregion
//#region Custom editors, mjbvz
export interface WebviewEditor extends WebviewPanel {
@@ -255,7 +255,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
return getRemoteName(initData.remote.authority);
},
get uiKind() {
checkProposedApiEnabled(extension);
return initData.uiKind;
}
};