Skip to content

Commit

Permalink
feat(1.97): add new extension endpoint (#2214)
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam authored Jan 25, 2025
1 parent 9418770 commit 0a2efd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions patches/merge-user-product.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/main.ts b/src/main.ts
index ff9a5e8..2135d00 100644
index 1504375..6bba7b8 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -8,2 +8,3 @@ import * as fs from 'original-fs';
Expand Down Expand Up @@ -30,19 +30,21 @@ index ff9a5e8..2135d00 100644
+ resolveUserProduct();

diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index 1a2a619..9bf5ac0 100644
index 1a2a619..e0da4ea 100644
--- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts
@@ -29,2 +29,36 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
@@ -29,2 +29,38 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {

+ const { serviceUrl, searchUrl, itemUrl, controlUrl } = product.extensionsGallery || {};
+ const { serviceUrl, searchUrl, itemUrl, controlUrl, extensionUrlTemplate, resourceUrlTemplate } = product.extensionsGallery || {};
+
+ Object.assign(product, {
+ extensionsGallery: {
+ serviceUrl: env['VSCODE_GALLERY_SERVICE_URL'] || serviceUrl,
+ searchUrl: env['VSCODE_GALLERY_SEARCH_URL'] || searchUrl,
+ itemUrl: env['VSCODE_GALLERY_ITEM_URL'] || itemUrl,
+ controlUrl: env['VSCODE_GALLERY_CONTROL_URL'] || controlUrl,
+ extensionUrlTemplate: env['VSCODE_GALLERY_EXTENSION_URL_TEMPLATE'] || extensionUrlTemplate,
+ resourceUrlTemplate: env['VSCODE_GALLERY_RESOURCE_URL_TEMPLATE'] || resourceUrlTemplate,
+ }
+ });
+
Expand Down
2 changes: 1 addition & 1 deletion prepare_vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ cp product.json{,.bak}

setpath "product" "checksumFailMoreInfoUrl" "https://go.microsoft.com/fwlink/?LinkId=828886"
setpath "product" "documentationUrl" "https://go.microsoft.com/fwlink/?LinkID=533484#vscode"
setpath_json "product" "extensionsGallery" '{"serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item"}'
setpath_json "product" "extensionsGallery" '{"serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item", "extensionUrlTemplate": "https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest"}'
setpath "product" "introductoryVideosUrl" "https://go.microsoft.com/fwlink/?linkid=832146"
setpath "product" "keyboardShortcutsUrlLinux" "https://go.microsoft.com/fwlink/?linkid=832144"
setpath "product" "keyboardShortcutsUrlMac" "https://go.microsoft.com/fwlink/?linkid=832143"
Expand Down

0 comments on commit 0a2efd9

Please sign in to comment.