diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 4f3e3e1f214..4aea3fcfb69 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1623,4 +1623,19 @@ declare module 'vscode' { } //#endregion + + + //#region + + export interface ExtensionContext { + /** + * Get the uri of a resource contained in the extension. + * + * @param relativePath A relative path to a resource contained in the extension. + * @return The uri of the resource. + */ + asExtensionUri(relativePath: string): Uri; + } + + //#endregion } diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index 978bf32fcda..16f5e3bca7a 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -369,7 +369,8 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio get extensionPath() { return extensionDescription.extensionLocation.fsPath; }, get storagePath() { return that._storagePath.workspaceValue(extensionDescription); }, get globalStoragePath() { return that._storagePath.globalValue(extensionDescription); }, - asAbsolutePath: (relativePath: string) => { return path.join(extensionDescription.extensionLocation.fsPath, relativePath); }, + asAbsolutePath(relativePath: string) { return path.join(extensionDescription.extensionLocation.fsPath, relativePath); }, + asExtensionUri(relativePath: string) { return joinPath(extensionDescription.extensionLocation, relativePath); }, get logPath() { return path.join(that._initData.logsLocation.fsPath, extensionDescription.identifier.value); } }); });