Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Code to 1.97.0 #7199

Merged
merged 5 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1370 files
60 changes: 24 additions & 36 deletions patches/base-path.diff
Original file line number Diff line number Diff line change
Expand Up @@ -111,65 +111,53 @@ 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
@@ -271,16 +271,15 @@ export class WebClientServer {
return void res.end();
}
@@ -246,7 +246,9 @@ export class WebClientServer {
};

// Prefix routes with basePath for clients
- const basePath = getFirstHeader('x-forwarded-prefix') || this._basePath;
+ const rootBase = relativeRoot(getOriginalUrl(req))
+ const vscodeBase = relativePath(getOriginalUrl(req))
+ const basePath = vscodeBase || getFirstHeader('x-forwarded-prefix') || this._basePath;

const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
if (typeof queryConnectionToken === 'string') {
@@ -285,10 +287,14 @@ export class WebClientServer {
};

- const getFirstHeader = (headerName: string) => {
- const val = req.headers[headerName];
- return Array.isArray(val) ? val[0] : val;
- };
-
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
+ // For now we are getting the remote authority from the client to avoid
+ // needing specific configuration for reverse proxies to work. Set this to
+ // something invalid to make sure we catch code that is using this value
+ // from the backend when it should not.
const remoteAuthority = (
let remoteAuthority = (
useTestResolver
? 'test+test'
- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host)
+ : 'remote'
);
if (!remoteAuthority) {
return serveError(req, res, 400, `Bad request.`);
@@ -307,8 +306,12 @@ export class WebClientServer {
scopes: [['user:email'], ['repo']]
} : undefined;
@@ -335,6 +341,7 @@ export class WebClientServer {

+ const base = relativeRoot(getOriginalUrl(req))
+ const vscodeBase = relativePath(getOriginalUrl(req))
+
const productConfiguration = {
codeServerVersion: this._productService.codeServerVersion,
+ rootEndpoint: base,
+ rootEndpoint: rootBase,
embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
...this._productService.extensionsGallery,
@@ -337,7 +340,7 @@ export class WebClientServer {
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
productConfiguration,
- callbackRoute: this._callbackRoute
+ callbackRoute: vscodeBase + this._callbackRoute
};

const cookies = cookie.parse(req.headers.cookie || '');
@@ -354,9 +357,11 @@ export class WebClientServer {
const values: { [key: string]: string } = {
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
@@ -382,7 +389,9 @@ export class WebClientServer {
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
WORKBENCH_WEB_BASE_URL: staticRoute,
WORKBENCH_NLS_URL,
- WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js`
+ WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${this._staticRoute}/out/nls.messages.js`,
+ BASE: base,
+ VS_BASE: vscodeBase,
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
+ WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
+ BASE: rootBase,
+ VS_BASE: basePath,
};

// DEV ---------------------------------------------------------------------------------------
@@ -393,7 +398,7 @@ export class WebClientServer {
@@ -419,7 +428,7 @@ export class WebClientServer {
'default-src \'self\';',
'img-src \'self\' https: data: blob:;',
'media-src \'self\';',
Expand All @@ -178,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
'child-src \'self\';',
`frame-src 'self' https://*.vscode-cdn.net data:;`,
'worker-src \'self\' data: blob:;',
@@ -466,3 +471,70 @@ export class WebClientServer {
@@ -492,3 +501,70 @@ export class WebClientServer {
return void res.end(data);
}
}
Expand Down
16 changes: 8 additions & 8 deletions patches/clipboard.diff
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
@@ -43,7 +43,12 @@ export interface ExtensionManagementPipe
@@ -44,7 +44,12 @@ export interface ExtensionManagementPipe
force?: boolean;
}

Expand All @@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts

export interface ICommandsExecuter {
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
@@ -105,6 +110,9 @@ export class CLIServerBase {
@@ -106,6 +111,9 @@ export class CLIServerBase {
case 'extensionManagement':
returnObj = await this.manageExtensions(data);
break;
Expand All @@ -50,7 +50,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
default:
sendResponse(404, `Unknown message type: ${data.type}`);
break;
@@ -172,6 +180,10 @@ export class CLIServerBase {
@@ -173,6 +181,10 @@ export class CLIServerBase {
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
}

Expand Down Expand Up @@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
@@ -119,6 +119,7 @@ export interface NativeParsedArgs {
@@ -121,6 +121,7 @@ export interface NativeParsedArgs {
sandbox?: boolean;

'enable-coi'?: boolean;
Expand All @@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
@@ -90,6 +90,7 @@ export const OPTIONS: OptionDescriptions
@@ -91,6 +91,7 @@ export const OPTIONS: OptionDescriptions
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
Expand All @@ -102,15 +102,15 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
@@ -76,6 +76,7 @@ const isSupportedForPipe = (optionId: ke
@@ -77,6 +77,7 @@ const isSupportedForPipe = (optionId: ke
case 'verbose':
case 'remote':
case 'locate-shell-integration-path':
+ case 'stdin-to-clipboard':
return true;
default:
return false;
@@ -293,6 +294,22 @@ export async function main(desc: Product
@@ -295,6 +296,22 @@ export async function main(desc: Product
}
}
} else {
Expand All @@ -131,5 +131,5 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
+ }
+
if (parsedArgs.status) {
sendToPipe({
await sendToPipe({
type: 'status'
2 changes: 1 addition & 1 deletion patches/disable-builtin-ext-update.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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
@@ -320,6 +320,10 @@ export class Extension implements IExten
@@ -321,6 +321,10 @@ export class Extension implements IExten
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
return false;
}
Expand Down
22 changes: 3 additions & 19 deletions patches/display-language.diff
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
import { CharCode } from '../../base/common/charCode.js';
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
@@ -98,6 +99,7 @@ export class WebClientServer {
private readonly _webExtensionResourceUrlTemplate: URI | undefined;

private readonly _staticRoute: string;
+ private readonly _serverRoot: string;
private readonly _callbackRoute: string;
private readonly _webExtensionRoute: string;

@@ -113,6 +115,7 @@ export class WebClientServer {
) {
this._webExtensionResourceUrlTemplate = this._productService.extensionsGallery?.resourceUrlTemplate ? URI.parse(this._productService.extensionsGallery.resourceUrlTemplate) : undefined;

+ this._serverRoot = serverRootPath;
this._staticRoute = `${serverRootPath}/static`;
this._callbackRoute = `${serverRootPath}/callback`;
this._webExtensionRoute = `/web-extension-resource`;
@@ -351,14 +354,22 @@ export class WebClientServer {
@@ -380,14 +381,22 @@ export class WebClientServer {
};

const cookies = cookie.parse(req.headers.cookie || '');
Expand All @@ -193,7 +177,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
+ try {
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
+ WORKBENCH_NLS_URL = nlsFile
+ ? `${vscodeBase}${this._serverRoot}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
+ ? `${vscodeBase}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
+ : '';
+ } catch (error) {
+ console.error("Failed to generate translations", error);
Expand All @@ -214,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts

/* ----- server setup ----- */

@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
@@ -106,6 +107,7 @@ export interface ServerParsedArgs {
'disable-file-downloads'?: boolean;
'disable-file-uploads'?: boolean;
'disable-getting-started-override'?: boolean,
Expand Down
12 changes: 6 additions & 6 deletions patches/external-file-actions.diff
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts

/* ----- server setup ----- */

@@ -99,6 +101,8 @@ export interface ServerParsedArgs {
@@ -100,6 +102,8 @@ export interface ServerParsedArgs {
/* ----- code-server ----- */
'disable-update-check'?: boolean;
'auth'?: string;
Expand All @@ -112,9 +112,9 @@ 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
@@ -335,6 +335,8 @@ export class WebClientServer {
serverBasePath: this._basePath,
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
@@ -364,6 +364,8 @@ export class WebClientServer {
serverBasePath: basePath,
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
userDataPath: this._environmentService.userDataPath,
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
+ isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
Expand Down Expand Up @@ -240,10 +240,10 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
@IPathService protected readonly pathService: IPathService,
@IKeybindingService private readonly keybindingService: IKeybindingService,
@@ -283,20 +283,22 @@ export class SimpleFileDialog extends Di
this.filePickBox.sortByLabel = false;
@@ -284,20 +284,22 @@ export class SimpleFileDialog extends Di
this.filePickBox.ignoreFocusOut = true;
this.filePickBox.ok = true;
this.filePickBox.okLabel = this.options.openLabel;
- if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
- this.filePickBox.customButton = true;
- this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');
Expand Down
8 changes: 4 additions & 4 deletions patches/getting-started.diff
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
import './gettingStartedColors.js';
@@ -834,6 +834,72 @@ export class GettingStartedPage extends
@@ -869,6 +869,72 @@ export class GettingStartedPage extends
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
);

Expand Down Expand Up @@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
const leftColumn = $('.categories-column.categories-column-left', {},);
const rightColumn = $('.categories-column.categories-column-right', {},);

@@ -869,6 +935,9 @@ export class GettingStartedPage extends
@@ -904,6 +970,9 @@ export class GettingStartedPage extends
recentList.setLimit(5);
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
}
Expand Down Expand Up @@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts

/* ----- server setup ----- */

@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
@@ -104,6 +105,7 @@ export interface ServerParsedArgs {
'auth'?: string;
'disable-file-downloads'?: boolean;
'disable-file-uploads'?: boolean;
Expand All @@ -201,7 +201,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
@@ -339,6 +339,7 @@ export class WebClientServer {
@@ -368,6 +368,7 @@ export class WebClientServer {
userDataPath: this._environmentService.userDataPath,
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
Expand Down
8 changes: 4 additions & 4 deletions patches/integration.diff
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
@@ -78,8 +78,11 @@ export class BrowserDialogHandler extend
@@ -77,8 +77,11 @@ export class BrowserDialogHandler extend

async about(): Promise<void> {
const detailString = (useAgo: boolean): string => {
Expand Down Expand Up @@ -187,10 +187,10 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
import { IndexedDB } from '../../base/browser/indexedDB.js';
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
+import { CodeServerClient } from '../../workbench/browser/client.js';
import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';
import { IProgressService } from '../../platform/progress/common/progress.js';
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
@@ -131,6 +132,9 @@ export class BrowserMain extends Disposa
import { dirname, joinPath } from '../../base/common/resources.js';
@@ -130,6 +131,9 @@ export class BrowserMain extends Disposa
// Startup
const instantiationService = workbench.startup();

Expand Down Expand Up @@ -269,7 +269,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
@@ -308,6 +308,7 @@ export class WebClientServer {
@@ -334,6 +334,7 @@ export class WebClientServer {
} : undefined;

const productConfiguration = {
Expand Down
10 changes: 5 additions & 5 deletions patches/local-storage.diff
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ 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
@@ -330,6 +330,7 @@ export class WebClientServer {
@@ -359,6 +359,7 @@ export class WebClientServer {
remoteAuthority,
serverBasePath: this._basePath,
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
serverBasePath: basePath,
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
+ userDataPath: this._environmentService.userDataPath,
_wrapWebWorkerExtHostInIframe,
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
Expand Down Expand Up @@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
@@ -145,8 +145,10 @@ export class WorkspaceService extends Di
@@ -147,8 +147,10 @@ export class WorkspaceService extends Di
this.workspaceConfiguration = this._register(new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService));
this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => {
this.onWorkspaceConfigurationChanged(fromCache).then(() => {
Expand All @@ -79,7 +79,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
});
}));

@@ -552,6 +554,12 @@ export class WorkspaceService extends Di
@@ -555,6 +557,12 @@ export class WorkspaceService extends Di
previousFolders = this.workspace.folders;
this.workspace.update(workspace);
} else {
Expand Down
Loading
Loading