diff --git a/lib/vscode b/lib/vscode index 74b1f9796..129500ee4 160000 --- a/lib/vscode +++ b/lib/vscode @@ -1 +1 @@ -Subproject commit 74b1f979648cc44d385a2286793c226e611f59e7 +Subproject commit 129500ee4c8ab7263461ffe327268ba56b9f210d diff --git a/patches/base-path.diff b/patches/base-path.diff index 867d43ab4..1d29f7ccf 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -104,7 +104,7 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactor connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void { const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws'); + path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/") - const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel); + const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel); const errorListener = socket.onError((err) => callback(err, undefined)); socket.onOpen(() => { @@ -282,6 +283,3 @@ export class BrowserSocketFactory implem @@ -262,7 +262,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts +++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts -@@ -485,6 +485,7 @@ function doCreateUri(path: string, query +@@ -489,6 +489,7 @@ function doCreateUri(path: string, query }); } @@ -270,7 +270,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts return URI.parse(window.location.href).with({ path, query }); } -@@ -496,7 +497,7 @@ function doCreateUri(path: string, query +@@ -500,7 +501,7 @@ function doCreateUri(path: string, query if (!configElement || !configElementAttribute) { throw new Error('Missing web configuration element'); } diff --git a/patches/cli-window-open.diff b/patches/cli-window-open.diff index 8b5d09d96..16d2ebc2b 100644 --- a/patches/cli-window-open.diff +++ b/patches/cli-window-open.diff @@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts -@@ -99,10 +99,14 @@ class RemoteTerminalBackend extends Base +@@ -100,10 +100,14 @@ class RemoteTerminalBackend extends Base } const reqId = e.reqId; const commandId = e.commandId; diff --git a/patches/disable-builtin-ext-update.diff b/patches/disable-builtin-ext-update.diff index adf6ca304..070b37443 100644 --- a/patches/disable-builtin-ext-update.diff +++ b/patches/disable-builtin-ext-update.diff @@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts -@@ -236,6 +236,10 @@ export class Extension implements IExten +@@ -237,6 +237,10 @@ export class Extension implements IExten if (this.type === ExtensionType.System && this.productService.quality === 'stable') { return false; } @@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) { return false; } -@@ -1121,6 +1125,10 @@ export class ExtensionsWorkbenchService +@@ -1234,6 +1238,10 @@ export class ExtensionsWorkbenchService // Skip if check updates only for builtin extensions and current extension is not builtin. continue; } diff --git a/patches/disable-downloads.diff b/patches/disable-downloads.diff index 3ed71ac83..5969911b9 100644 --- a/patches/disable-downloads.diff +++ b/patches/disable-downloads.diff @@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts +++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts -@@ -267,6 +267,11 @@ export interface IWorkbenchConstructionO +@@ -271,6 +271,11 @@ export interface IWorkbenchConstructionO */ readonly userDataPath?: string @@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -95,6 +96,7 @@ export interface ServerParsedArgs { +@@ -94,6 +95,7 @@ export interface ServerParsedArgs { /* ----- code-server ----- */ 'disable-update-check'?: boolean; 'auth'?: string @@ -84,8 +84,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts userDataPath: this._environmentService.userDataPath, + isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'], _wrapWebWorkerExtHostInIframe, - developmentOptions: { - enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, + settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts @@ -93,16 +93,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts @@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev import { Disposable } from 'vs/base/common/lifecycle'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; - import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext } from 'vs/platform/contextkey/common/contextkeys'; --import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext } from 'vs/workbench/common/contextkeys'; -+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys'; + import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys'; +-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext } from 'vs/workbench/common/contextkeys'; ++import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys'; import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor'; import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom'; import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; - import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; + import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace'; import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; @@ -25,6 +24,7 @@ import { IPaneCompositePartService } fro import { Schemas } from 'vs/base/common/network'; @@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts export class WorkbenchContextKeysHandler extends Disposable { private inputFocusedContext: IContextKey; -@@ -76,7 +76,7 @@ export class WorkbenchContextKeysHandler +@@ -77,7 +77,7 @@ export class WorkbenchContextKeysHandler @IContextKeyService private readonly contextKeyService: IContextKeyService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -121,7 +121,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts @IProductService private readonly productService: IProductService, @IEditorService private readonly editorService: IEditorService, @IEditorResolverService private readonly editorResolverService: IEditorResolverService, -@@ -199,6 +199,9 @@ export class WorkbenchContextKeysHandler +@@ -202,6 +202,9 @@ export class WorkbenchContextKeysHandler this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService); this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART)); @@ -172,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts +++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts -@@ -30,6 +30,8 @@ export const IsFullscreenContext = new R +@@ -32,6 +32,8 @@ export const IsFullscreenContext = new R export const HasWebFileSystemAccess = new RawContextKey('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access) diff --git a/patches/display-language.diff b/patches/display-language.diff index 6bfec9e9b..a7c73efb7 100644 --- a/patches/display-language.diff +++ b/patches/display-language.diff @@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts +++ code-server/lib/vscode/src/vs/server/node/serverServices.ts -@@ -212,6 +212,9 @@ export async function setupServerService +@@ -209,6 +209,9 @@ export async function setupServerService const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)); socketServer.registerChannel('extensions', channel); @@ -39,11 +39,11 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; - - const LANGUAGE_DEFAULT = 'en'; + export const LANGUAGE_DEFAULT = 'en'; let _isWindows = false; -@@ -81,17 +79,19 @@ if (typeof navigator === 'object' && !is - _isLinux = _userAgent.indexOf('Linux') >= 0; +@@ -83,17 +81,19 @@ if (typeof navigator === 'object' && !is + _isMobile = _userAgent?.indexOf('Mobi') >= 0; _isWeb = true; - const configuredLocale = nls.getConfiguredDefaultLocale( @@ -216,7 +216,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts const workbenchWebConfiguration = { remoteAuthority, -@@ -339,6 +342,7 @@ export class WebClientServer { +@@ -336,6 +339,7 @@ export class WebClientServer { WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''), BASE: base, VS_BASE: vscodeBase, @@ -236,7 +236,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -97,6 +98,7 @@ export interface ServerParsedArgs { +@@ -96,6 +97,7 @@ export interface ServerParsedArgs { 'disable-update-check'?: boolean; 'auth'?: string 'disable-file-downloads'?: boolean; @@ -248,7 +248,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts +++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts -@@ -122,8 +122,9 @@ import 'vs/workbench/contrib/logs/browse +@@ -123,8 +123,9 @@ import 'vs/workbench/contrib/logs/browse // Explorer import 'vs/workbench/contrib/files/browser/files.web.contribution'; @@ -314,19 +314,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true); return true; } -Index: code-server/lib/vscode/src/vs/base/node/languagePacks.js -=================================================================== ---- code-server.orig/lib/vscode/src/vs/base/node/languagePacks.js -+++ code-server/lib/vscode/src/vs/base/node/languagePacks.js -@@ -73,7 +73,10 @@ - function getLanguagePackConfigurations(userDataPath) { - const configFile = path.join(userDataPath, 'languagepacks.json'); - try { -- return nodeRequire(configFile); -+ // This must not use Node's require otherwise it will be cached forever. -+ // Code can get away with this since the process actually restarts but -+ // that is not currently the case with code-server. -+ return JSON.parse(fs.readFileSync(configFile, "utf8")); - } catch (err) { - // Do nothing. If we can't read the file we have no - // language pack config. diff --git a/patches/integration.diff b/patches/integration.diff index fd1fb03f0..3916af325 100644 --- a/patches/integration.diff +++ b/patches/integration.diff @@ -221,12 +221,13 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html -@@ -26,8 +27,9 @@ +@@ -26,9 +27,9 @@ - - +- + + + diff --git a/patches/local-storage.diff b/patches/local-storage.diff index fe0b59c0b..f9aca09e5 100644 --- a/patches/local-storage.diff +++ b/patches/local-storage.diff @@ -26,13 +26,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', + userDataPath: this._environmentService.userDataPath, _wrapWebWorkerExtHostInIframe, - developmentOptions: { - enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, + settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts +++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts -@@ -262,6 +262,11 @@ export interface IWorkbenchConstructionO +@@ -266,6 +266,11 @@ export interface IWorkbenchConstructionO */ readonly configurationDefaults?: Record; diff --git a/patches/log-level.diff b/patches/log-level.diff deleted file mode 100644 index 5961f989a..000000000 --- a/patches/log-level.diff +++ /dev/null @@ -1,21 +0,0 @@ -Propagate the log level to the client - -This can be tested by using `--log trace`. You should see plenty of debug and -trace logs in the console. - -Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts -=================================================================== ---- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts -+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -304,7 +304,10 @@ export class WebClientServer { - remoteAuthority, - webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', - _wrapWebWorkerExtHostInIframe, -- developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined }, -+ developmentOptions: { -+ enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, -+ logLevel: this._logService.getLevel(), -+ }, - settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, - enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'], - folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']), diff --git a/patches/logout.diff b/patches/logout.diff index 400708885..01eddce29 100644 --- a/patches/logout.diff +++ b/patches/logout.diff @@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -93,6 +94,7 @@ export const serverOptions: OptionDescri +@@ -92,6 +93,7 @@ export const serverOptions: OptionDescri export interface ServerParsedArgs { /* ----- code-server ----- */ 'disable-update-check'?: boolean; diff --git a/patches/marketplace.diff b/patches/marketplace.diff index d079d2b0e..4056dcd3f 100644 --- a/patches/marketplace.diff +++ b/patches/marketplace.diff @@ -19,22 +19,23 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts +++ code-server/lib/vscode/src/vs/platform/product/common/product.ts -@@ -45,7 +45,14 @@ else if (typeof require?.__$__nodeRequir +@@ -53,6 +53,16 @@ else if (typeof require?.__$__nodeRequir + version: pkg.version + }); } - - Object.assign(product, { -- version: pkg.version -+ version: pkg.version, ++ ++ Object.assign(product, { + extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || { + serviceUrl: "https://open-vsx.org/vscode/gallery", + itemUrl: "https://open-vsx.org/vscode/item", + resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}", + controlUrl: "", + recommendationsUrl: "", -+ }), - }); ++ }) ++ }); } + // Web environment or unknown Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts diff --git a/patches/proposed-api.diff b/patches/proposed-api.diff index 09333557b..ca6282313 100644 --- a/patches/proposed-api.diff +++ b/patches/proposed-api.diff @@ -9,7 +9,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstra =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts -@@ -1458,7 +1458,7 @@ class ProposedApiController { +@@ -1462,7 +1462,7 @@ class ProposedApiController { this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id))); diff --git a/patches/proxy-uri.diff b/patches/proxy-uri.diff index 4065d4874..95933402e 100644 --- a/patches/proxy-uri.diff +++ b/patches/proxy-uri.diff @@ -98,7 +98,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts -@@ -388,7 +388,7 @@ export async function createTerminalEnvi +@@ -392,7 +392,7 @@ export async function createTerminalEnvi // Sanitize the environment, removing any undesirable VS Code and Electron environment // variables @@ -111,15 +111,15 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts +++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts -@@ -17,6 +17,7 @@ import { isFolderToOpen, isWorkspaceToOp - import { create, ICredentialsProvider, IURLCallbackProvider, IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/workbench.web.main'; - import { posix } from 'vs/base/common/path'; - import { ltrim } from 'vs/base/common/strings'; +@@ -21,6 +21,7 @@ import type { ICredentialsProvider } fro + import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService'; + import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api'; + import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService'; +import { extractLocalHostUriMetaDataForPortMapping } from 'vs/platform/tunnel/common/tunnel'; interface ICredential { service: string; -@@ -507,6 +508,21 @@ function doCreateUri(path: string, query +@@ -511,6 +512,21 @@ function doCreateUri(path: string, query } : undefined, workspaceProvider: WorkspaceProvider.create(config), urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute), diff --git a/patches/series b/patches/series index e5289b4bd..66df7f905 100644 --- a/patches/series +++ b/patches/series @@ -11,7 +11,6 @@ store-socket.diff proxy-uri.diff github-auth.diff unique-db.diff -log-level.diff local-storage.diff service-worker.diff sourcemaps.diff diff --git a/patches/service-worker.diff b/patches/service-worker.diff index ce902f64c..dec1ffe8c 100644 --- a/patches/service-worker.diff +++ b/patches/service-worker.diff @@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -319,6 +319,10 @@ export class WebClientServer { +@@ -316,6 +316,10 @@ export class WebClientServer { updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined, logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined, proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}', diff --git a/patches/sourcemaps.diff b/patches/sourcemaps.diff index 22c593a3e..ddd227d3a 100644 --- a/patches/sourcemaps.diff +++ b/patches/sourcemaps.diff @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js =================================================================== --- code-server.orig/lib/vscode/build/gulpfile.reh.js +++ code-server/lib/vscode/build/gulpfile.reh.js -@@ -196,8 +196,7 @@ function packageTask(type, platform, arc +@@ -191,8 +191,7 @@ function packageTask(type, platform, arc const src = gulp.src(sourceFolderName + '/**', { base: '.' }) .pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); })) @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js const workspaceExtensionPoints = ['debuggers', 'jsonValidation']; const isUIExtension = (manifest) => { -@@ -236,9 +235,9 @@ function packageTask(type, platform, arc +@@ -231,9 +230,9 @@ function packageTask(type, platform, arc .map(name => `.build/extensions/${name}/**`); const extensions = gulp.src(extensionPaths, { base: '.build', dot: true }); @@ -32,12 +32,12 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js let version = packageJson.version; const quality = product.quality; -@@ -373,7 +372,7 @@ function tweakProductForServerWeb(produc +@@ -387,7 +386,7 @@ function tweakProductForServerWeb(produc const minifyTask = task.define(`minify-vscode-${type}`, task.series( optimizeTask, util.rimraf(`out-vscode-${type}-min`), -- common.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`) -+ common.minifyTask(`out-vscode-${type}`, '') +- optimize.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`) ++ optimize.minifyTask(`out-vscode-${type}`, ``) )); gulp.task(minifyTask); diff --git a/patches/telemetry.diff b/patches/telemetry.diff index 7245d2d58..a57f2736d 100644 --- a/patches/telemetry.diff +++ b/patches/telemetry.diff @@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -324,6 +324,7 @@ export class WebClientServer { +@@ -321,6 +321,7 @@ export class WebClientServer { scope: vscodeBase + '/', path: base + '/_static/out/browser/serviceWorker.js', }, diff --git a/patches/unique-db.diff b/patches/unique-db.diff index f03a3a933..576457373 100644 --- a/patches/unique-db.diff +++ b/patches/unique-db.diff @@ -14,23 +14,23 @@ Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageS --- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts +++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts @@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi - import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; + import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { hash } from 'vs/base/common/hash'; export class BrowserStorageService extends AbstractStorageService { -@@ -67,7 +68,11 @@ export class BrowserStorageService exten - return `global-${this.profileStorageProfile.id}`; - } - case StorageScope.WORKSPACE: -- return this.payload.id; -+ // Add a unique ID based on the current path for per-workspace databases. -+ // This prevents workspaces on different machines that share the same domain -+ // and file path from colliding (since it does not appear IndexedDB can be -+ // scoped to a path) as long as they are hosted on different paths. -+ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16); - } +@@ -297,7 +298,11 @@ export class IndexedDBStorageDatabase ex } + static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise { +- return IndexedDBStorageDatabase.create({ id: workspaceId }, logService); ++ // Add a unique ID based on the current path for per-workspace databases. ++ // This prevents workspaces on different machines that share the same domain ++ // and file path from colliding (since it does not appear IndexedDB can be ++ // scoped to a path) as long as they are hosted on different paths. ++ return IndexedDBStorageDatabase.create({ id: workspaceId + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16) }, logService); + } + + static async create(options: IndexedDBStorageDatabaseOptions, logService: ILogService): Promise { diff --git a/patches/update-check.diff b/patches/update-check.diff index ba81a4b4c..86edbce37 100644 --- a/patches/update-check.diff +++ b/patches/update-check.diff @@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -89,6 +91,8 @@ export const serverOptions: OptionDescri +@@ -88,6 +90,8 @@ export const serverOptions: OptionDescri }; export interface ServerParsedArgs { diff --git a/patches/webview.diff b/patches/webview.diff index 2c2c69250..49af19cb8 100644 --- a/patches/webview.diff +++ b/patches/webview.diff @@ -20,6 +20,11 @@ webview host is separate by default but we serve on the same host). To test, open a few types of webviews (images, markdown, extension details, etc). +Make sure to update the hash. To do so: +1. run code-server +2. open any webview (i.e. preview Markdown) +3. see error in console and copy hash + Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts @@ -43,21 +48,12 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts remoteAuthority, + webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', _wrapWebWorkerExtHostInIframe, - developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined }, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html +++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html -@@ -5,7 +5,7 @@ - - - -+ content="default-src 'none'; script-src 'sha256-BRi/ZOLWtsisl3jAheglVzKmoA1T6n2Mmf2NM4UnIXE=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> - - -