From 1bdce461605a6fb0deb26c6e854d7dca1c1fa7c4 Mon Sep 17 00:00:00 2001 From: Vincent Fugnitto Date: Thu, 18 May 2023 10:13:58 -0400 Subject: [PATCH] vscode: add `ProfileContentHandler` stubbing (#12535) The commit adds stubbing for the proposed `ProfileContentHandler` VS Code API. The stubbing was necessary in order for the `vscode.configuration-editing` builtin to successfully activate. Signed-off-by: vince-fugnitto --- packages/plugin-ext/src/plugin/plugin-context.ts | 7 +++++-- packages/plugin/src/theia-proposed.d.ts | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/plugin-ext/src/plugin/plugin-context.ts b/packages/plugin-ext/src/plugin/plugin-context.ts index c8f3bce54c874..8e601b5ac9929 100644 --- a/packages/plugin-ext/src/plugin/plugin-context.ts +++ b/packages/plugin-ext/src/plugin/plugin-context.ts @@ -575,10 +575,13 @@ export function createAPIFactory( get tabGroups(): theia.TabGroups { return tabsExt.tabGroups; }, - - // ExternalUriOpener @stubbed + /** @stubbed ExternalUriOpener */ registerExternalUriOpener(id: string, opener: theia.ExternalUriOpener, metadata: theia.ExternalUriOpenerMetadata): theia.Disposable { return Disposable.NULL; + }, + /** @stubbed ProfileContentHandler */ + registerProfileContentHandler(id: string, profileContentHandler: theia.ProfileContentHandler): theia.Disposable { + return Disposable.NULL; } }; diff --git a/packages/plugin/src/theia-proposed.d.ts b/packages/plugin/src/theia-proposed.d.ts index 9ce7b3c3db907..6f094ac01508d 100644 --- a/packages/plugin/src/theia-proposed.d.ts +++ b/packages/plugin/src/theia-proposed.d.ts @@ -706,6 +706,20 @@ export module '@theia/plugin' { } // #endregion + + // #region ProfileContentHandler + + export interface ProfileContentHandler { + readonly name: string; + saveProfile(name: string, content: string, token: CancellationToken): Thenable; + readProfile(uri: Uri, token: CancellationToken): Thenable; + } + + export namespace window { + export function registerProfileContentHandler(id: string, profileContentHandler: ProfileContentHandler): Disposable; + } + + // #endregion ProfileContentHandler } /**