Skip to content

Commit

Permalink
vscode: add ProfileContentHandler stubbing (#12535)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vince-fugnitto authored and tsmaeder committed May 23, 2023
1 parent 10503eb commit 1bdce46
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down
14 changes: 14 additions & 0 deletions packages/plugin/src/theia-proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Uri | null>;
readProfile(uri: Uri, token: CancellationToken): Thenable<string | null>;
}

export namespace window {
export function registerProfileContentHandler(id: string, profileContentHandler: ProfileContentHandler): Disposable;
}

// #endregion ProfileContentHandler
}

/**
Expand Down

0 comments on commit 1bdce46

Please sign in to comment.