|
| 1 | +Index: sagemaker-code-editor/vscode/src/vs/platform/product/common/product.ts |
| 2 | +=================================================================== |
| 3 | +--- sagemaker-code-editor.orig/vscode/src/vs/platform/product/common/product.ts |
| 4 | ++++ sagemaker-code-editor/vscode/src/vs/platform/product/common/product.ts |
| 5 | +@@ -47,6 +47,27 @@ else if (globalThis._VSCODE_PRODUCT_JSON |
| 6 | + version: pkg.version |
| 7 | + }); |
| 8 | + } |
| 9 | ++ |
| 10 | ++ if (env['EXTENSIONS_GALLERY']) { |
| 11 | ++ console.log(`Custom extensions gallery detected. Parsing...`); |
| 12 | ++ Object.assign(product, { |
| 13 | ++ extensionsGallery: JSON.parse(env['EXTENSIONS_GALLERY']) |
| 14 | ++ }); |
| 15 | ++ } else { |
| 16 | ++ console.log(`Using default extensions gallery.`); |
| 17 | ++ Object.assign(product, { |
| 18 | ++ extensionsGallery: (product.extensionsGallery || { |
| 19 | ++ serviceUrl: "https://open-vsx.org/vscode/gallery", |
| 20 | ++ itemUrl: "https://open-vsx.org/vscode/item", |
| 21 | ++ resourceUrlTemplate: "https://open-vsx.org/vscode/unpkg/{publisher}/{name}/{version}/{path}", |
| 22 | ++ controlUrl: "", |
| 23 | ++ recommendationsUrl: "", |
| 24 | ++ nlsBaseUrl: "", |
| 25 | ++ publisherUrl: "" |
| 26 | ++ }) |
| 27 | ++ }); |
| 28 | ++ } |
| 29 | ++ console.log(JSON.stringify(product.extensionsGallery, null, 2)); |
| 30 | + } |
| 31 | + |
| 32 | + // Web environment or unknown |
| 33 | +Index: sagemaker-code-editor/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts |
| 34 | +=================================================================== |
| 35 | +--- sagemaker-code-editor.orig/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts |
| 36 | ++++ sagemaker-code-editor/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts |
| 37 | +@@ -64,6 +64,8 @@ import { ILocalizedString } from 'vs/pla |
| 38 | + import { registerNavigableContainer } from 'vs/workbench/browser/actions/widgetNavigationCommands'; |
| 39 | + import { MenuWorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; |
| 40 | + import { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; |
| 41 | ++import { IProductService } from 'vs/platform/product/common/productService'; |
| 42 | ++import { memoize } from 'vs/base/common/decorators'; |
| 43 | + |
| 44 | + export const DefaultViewsContext = new RawContextKey<boolean>('defaultExtensionViews', true); |
| 45 | + export const ExtensionsSortByContext = new RawContextKey<string>('extensionsSortByValue', ''); |
| 46 | +@@ -87,7 +89,6 @@ const SortByUpdateDateContext = new RawC |
| 47 | + const REMOTE_CATEGORY: ILocalizedString = localize2({ key: 'remote', comment: ['Remote as in remote machine'] }, "Remote"); |
| 48 | + |
| 49 | + export class ExtensionsViewletViewsContribution extends Disposable implements IWorkbenchContribution { |
| 50 | +- |
| 51 | + private readonly container: ViewContainer; |
| 52 | + |
| 53 | + constructor( |
| 54 | +@@ -516,7 +517,8 @@ export class ExtensionsViewPaneContainer |
| 55 | + @IExtensionService extensionService: IExtensionService, |
| 56 | + @IViewDescriptorService viewDescriptorService: IViewDescriptorService, |
| 57 | + @IPreferencesService private readonly preferencesService: IPreferencesService, |
| 58 | +- @ICommandService private readonly commandService: ICommandService |
| 59 | ++ @ICommandService private readonly commandService: ICommandService, |
| 60 | ++ @IProductService private readonly productService: IProductService, |
| 61 | + ) { |
| 62 | + super(VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService); |
| 63 | + |
| 64 | +@@ -544,6 +546,15 @@ export class ExtensionsViewPaneContainer |
| 65 | + this.searchViewletState = this.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE); |
| 66 | + } |
| 67 | + |
| 68 | ++ @memoize |
| 69 | ++ get extensionsGalleryHostname(): string { |
| 70 | ++ if (this.productService.extensionsGallery?.serviceUrl) { |
| 71 | ++ return new URL(this.productService.extensionsGallery?.serviceUrl).hostname; |
| 72 | ++ } |
| 73 | ++ |
| 74 | ++ return 'Marketplace'; |
| 75 | ++ } |
| 76 | ++ |
| 77 | + get searchValue(): string | undefined { |
| 78 | + return this.searchBox?.getValue(); |
| 79 | + } |
| 80 | +@@ -558,8 +569,7 @@ export class ExtensionsViewPaneContainer |
| 81 | + hide(overlay); |
| 82 | + |
| 83 | + const header = append(this.root, $('.header')); |
| 84 | +- const placeholder = localize('searchExtensions', "Search Extensions in Marketplace"); |
| 85 | +- |
| 86 | ++ const placeholder = localize('searchExtensions', 'Search extensions in {0}', this.extensionsGalleryHostname); |
| 87 | + const searchValue = this.searchViewletState['query.value'] ? this.searchViewletState['query.value'] : ''; |
| 88 | + |
| 89 | + const searchContainer = append(header, $('.extensions-search-container')); |
| 90 | +@@ -924,4 +934,4 @@ export class MaliciousExtensionChecker i |
| 91 | + }).then(() => undefined); |
| 92 | + }, err => this.logService.error(err)); |
| 93 | + } |
| 94 | +-} |
| 95 | ++} |
| 96 | +\ No newline at end of file |
| 97 | +Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts |
| 98 | +=================================================================== |
| 99 | +--- sagemaker-code-editor.orig/vscode/src/vs/server/node/webClientServer.ts |
| 100 | ++++ sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts |
| 101 | +@@ -320,14 +320,7 @@ export class WebClientServer { |
| 102 | + const productConfiguration = { |
| 103 | + rootEndpoint: base, |
| 104 | + embedderIdentifier: 'server-distro', |
| 105 | +- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? { |
| 106 | +- ...this._productService.extensionsGallery, |
| 107 | +- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({ |
| 108 | +- scheme: 'http', |
| 109 | +- authority: remoteAuthority, |
| 110 | +- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}` |
| 111 | +- }).toString(true) |
| 112 | +- } : undefined |
| 113 | ++ extensionsGallery: this._productService.extensionsGallery, |
| 114 | + } satisfies Partial<IProductConfiguration>; |
| 115 | + |
| 116 | + if (!this._environmentService.isBuilt) { |
| 117 | +Index: sagemaker-code-editor/vscode/product.json |
| 118 | +=================================================================== |
| 119 | +--- sagemaker-code-editor.orig/vscode/product.json |
| 120 | ++++ sagemaker-code-editor/vscode/product.json |
| 121 | +@@ -33,15 +33,6 @@ |
| 122 | + "webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/", |
| 123 | + "builtInExtensions": [ |
| 124 | + ], |
| 125 | +- "extensionsGallery": { |
| 126 | +- "serviceUrl": "https://open-vsx.org/vscode/gallery", |
| 127 | +- "itemUrl": "https://open-vsx.org/vscode/item", |
| 128 | +- "resourceUrlTemplate": "https://open-vsx.org/vscode/unpkg/{publisher}/{name}/{version}/{path}", |
| 129 | +- "controlUrl": "", |
| 130 | +- "recommendationsUrl": "", |
| 131 | +- "nlsBaseUrl": "", |
| 132 | +- "publisherUrl": "" |
| 133 | +- }, |
| 134 | + "linkProtectionTrustedDomains": [ |
| 135 | + "https://open-vsx.org" |
| 136 | + ] |
0 commit comments