Skip to content

Commit 72c3bce

Browse files
committed
expose extensionUri, microsoft#90208
1 parent e32e495 commit 72c3bce

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,11 @@ declare module 'vscode' {
16721672
* @return The uri of the resource.
16731673
*/
16741674
asExtensionUri(relativePath: string): Uri;
1675+
1676+
/**
1677+
*
1678+
*/
1679+
readonly extensionUri: Uri;
16751680
}
16761681

16771682
export interface Extension<T> {
@@ -1682,6 +1687,11 @@ declare module 'vscode' {
16821687
* @return The uri of the resource.
16831688
*/
16841689
asExtensionUri(relativePath: string): Uri;
1690+
1691+
/**
1692+
*
1693+
*/
1694+
readonly extensionUri: Uri;
16851695
}
16861696

16871697
//#endregion

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ class Extension<T> implements vscode.Extension<T> {
10151015
private _identifier: ExtensionIdentifier;
10161016

10171017
readonly id: string;
1018+
readonly extensionUri: URI;
10181019
readonly extensionPath: string;
10191020
readonly packageJSON: IExtensionDescription;
10201021
readonly extensionKind: vscode.ExtensionKind;
@@ -1024,6 +1025,7 @@ class Extension<T> implements vscode.Extension<T> {
10241025
this._originExtensionId = originExtensionId;
10251026
this._identifier = description.identifier;
10261027
this.id = description.identifier.value;
1028+
this.extensionUri = description.extensionLocation;
10271029
this.extensionPath = path.normalize(originalFSPath(description.extensionLocation));
10281030
this.packageJSON = description;
10291031
this.extensionKind = kind;

src/vs/workbench/api/common/extHostExtensionService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
366366
globalState,
367367
workspaceState,
368368
subscriptions: [],
369+
get extensionUri() { return extensionDescription.extensionLocation; },
369370
get extensionPath() { return extensionDescription.extensionLocation.fsPath; },
370371
get storagePath() { return that._storagePath.workspaceValue(extensionDescription); },
371372
get globalStoragePath() { return that._storagePath.globalValue(extensionDescription); },

0 commit comments

Comments
 (0)