diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 4f3e3e1f214ac2a99581bd75fdfe4d5a6504adf7..4aea3fcfb691382f6056029a8387308f02794a2d 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 978bf32fcda5b003a5c695cb8287005e47fb1c53..16f5e3bca7a7a97ec0dd9ca3900e0900eac39735 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); } }); });