提交 b4eb9933 编写于 作者: J Johannes Rieken

add asExtensionUri-api proposal

上级 675b553d
......@@ -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
}
......@@ -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); }
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册