Skip to content

Commit fee4713

Browse files
benz0licode-asher
authored andcommitted
Update Code to 1.97.0
1 parent a6fad66 commit fee4713

17 files changed

+70
-93
lines changed

lib/vscode

Submodule vscode updated 1370 files

patches/base-path.diff

+14-20
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,23 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
111111
===================================================================
112112
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
113113
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
114-
@@ -271,16 +271,15 @@ export class WebClientServer {
115-
return void res.end();
116-
}
114+
@@ -285,10 +285,14 @@ export class WebClientServer {
115+
};
117116

118-
- const getFirstHeader = (headerName: string) => {
119-
- const val = req.headers[headerName];
120-
- return Array.isArray(val) ? val[0] : val;
121-
- };
122-
-
123117
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
124118
+ // For now we are getting the remote authority from the client to avoid
125119
+ // needing specific configuration for reverse proxies to work. Set this to
126120
+ // something invalid to make sure we catch code that is using this value
127121
+ // from the backend when it should not.
128-
const remoteAuthority = (
122+
let remoteAuthority = (
129123
useTestResolver
130124
? 'test+test'
131125
- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host)
132126
+ : 'remote'
133127
);
134128
if (!remoteAuthority) {
135129
return serveError(req, res, 400, `Bad request.`);
136-
@@ -307,8 +306,12 @@ export class WebClientServer {
130+
@@ -333,8 +337,12 @@ export class WebClientServer {
137131
scopes: [['user:email'], ['repo']]
138132
} : undefined;
139133

@@ -146,30 +140,30 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
146140
embedderIdentifier: 'server-distro',
147141
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
148142
...this._productService.extensionsGallery,
149-
@@ -337,7 +340,7 @@ export class WebClientServer {
143+
@@ -363,7 +371,7 @@ export class WebClientServer {
150144
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
151145
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
152146
productConfiguration,
153-
- callbackRoute: this._callbackRoute
154-
+ callbackRoute: vscodeBase + this._callbackRoute
147+
- callbackRoute: callbackRoute
148+
+ callbackRoute: vscodeBase + callbackRoute
155149
};
156150

157151
const cookies = cookie.parse(req.headers.cookie || '');
158-
@@ -354,9 +357,11 @@ export class WebClientServer {
152+
@@ -380,9 +388,11 @@ export class WebClientServer {
159153
const values: { [key: string]: string } = {
160154
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
161155
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
162-
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
163-
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
156+
- WORKBENCH_WEB_BASE_URL: staticRoute,
157+
+ WORKBENCH_WEB_BASE_URL: vscodeBase + staticRoute,
164158
WORKBENCH_NLS_URL,
165-
- WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js`
166-
+ WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${this._staticRoute}/out/nls.messages.js`,
159+
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
160+
+ WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${staticRoute}/out/nls.messages.js`,
167161
+ BASE: base,
168162
+ VS_BASE: vscodeBase,
169163
};
170164

171165
// DEV ---------------------------------------------------------------------------------------
172-
@@ -393,7 +398,7 @@ export class WebClientServer {
166+
@@ -419,7 +429,7 @@ export class WebClientServer {
173167
'default-src \'self\';',
174168
'img-src \'self\' https: data: blob:;',
175169
'media-src \'self\';',
@@ -178,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
178172
'child-src \'self\';',
179173
`frame-src 'self' https://*.vscode-cdn.net data:;`,
180174
'worker-src \'self\' data: blob:;',
181-
@@ -466,3 +471,70 @@ export class WebClientServer {
175+
@@ -492,3 +502,70 @@ export class WebClientServer {
182176
return void res.end(data);
183177
}
184178
}

patches/clipboard.diff

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
2626
===================================================================
2727
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
2828
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
29-
@@ -43,7 +43,12 @@ export interface ExtensionManagementPipe
29+
@@ -44,7 +44,12 @@ export interface ExtensionManagementPipe
3030
force?: boolean;
3131
}
3232

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

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

@@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
7878
===================================================================
7979
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
8080
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
81-
@@ -119,6 +119,7 @@ export interface NativeParsedArgs {
81+
@@ -121,6 +121,7 @@ export interface NativeParsedArgs {
8282
sandbox?: boolean;
8383

8484
'enable-coi'?: boolean;
@@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
9090
===================================================================
9191
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
9292
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
93-
@@ -90,6 +90,7 @@ export const OPTIONS: OptionDescriptions
93+
@@ -91,6 +91,7 @@ export const OPTIONS: OptionDescriptions
9494
'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.") },
9595
'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.") },
9696
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
@@ -102,15 +102,15 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
102102
===================================================================
103103
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
104104
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
105-
@@ -76,6 +76,7 @@ const isSupportedForPipe = (optionId: ke
105+
@@ -77,6 +77,7 @@ const isSupportedForPipe = (optionId: ke
106106
case 'verbose':
107107
case 'remote':
108108
case 'locate-shell-integration-path':
109109
+ case 'stdin-to-clipboard':
110110
return true;
111111
default:
112112
return false;
113-
@@ -293,6 +294,22 @@ export async function main(desc: Product
113+
@@ -295,6 +296,22 @@ export async function main(desc: Product
114114
}
115115
}
116116
} else {
@@ -131,5 +131,5 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
131131
+ }
132132
+
133133
if (parsedArgs.status) {
134-
sendToPipe({
134+
await sendToPipe({
135135
type: 'status'

patches/disable-builtin-ext-update.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
77
===================================================================
88
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
99
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
10-
@@ -320,6 +320,10 @@ export class Extension implements IExten
10+
@@ -321,6 +321,10 @@ export class Extension implements IExten
1111
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
1212
return false;
1313
}

patches/display-language.diff

+8-16
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,15 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
161161
import { CharCode } from '../../base/common/charCode.js';
162162
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
163163
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
164-
@@ -98,6 +99,7 @@ export class WebClientServer {
165-
private readonly _webExtensionResourceUrlTemplate: URI | undefined;
164+
@@ -325,7 +326,6 @@ export class WebClientServer {
166165

167-
private readonly _staticRoute: string;
168-
+ private readonly _serverRoot: string;
169-
private readonly _callbackRoute: string;
170-
private readonly _webExtensionRoute: string;
166+
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
167+
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
168+
- const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);
171169

172-
@@ -113,6 +115,7 @@ export class WebClientServer {
173-
) {
174-
this._webExtensionResourceUrlTemplate = this._productService.extensionsGallery?.resourceUrlTemplate ? URI.parse(this._productService.extensionsGallery.resourceUrlTemplate) : undefined;
170+
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(path.resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
175171

176-
+ this._serverRoot = serverRootPath;
177-
this._staticRoute = `${serverRootPath}/static`;
178-
this._callbackRoute = `${serverRootPath}/callback`;
179-
this._webExtensionRoute = `/web-extension-resource`;
180-
@@ -351,14 +354,22 @@ export class WebClientServer {
172+
@@ -382,14 +382,22 @@ export class WebClientServer {
181173
};
182174

183175
const cookies = cookie.parse(req.headers.cookie || '');
@@ -193,7 +185,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
193185
+ try {
194186
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
195187
+ WORKBENCH_NLS_URL = nlsFile
196-
+ ? `${vscodeBase}${this._serverRoot}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
188+
+ ? `${vscodeBase}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
197189
+ : '';
198190
+ } catch (error) {
199191
+ console.error("Failed to generate translations", error);
@@ -214,7 +206,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
214206

215207
/* ----- server setup ----- */
216208

217-
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
209+
@@ -106,6 +107,7 @@ export interface ServerParsedArgs {
218210
'disable-file-downloads'?: boolean;
219211
'disable-file-uploads'?: boolean;
220212
'disable-getting-started-override'?: boolean,

patches/external-file-actions.diff

+6-6
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
9999

100100
/* ----- server setup ----- */
101101

102-
@@ -99,6 +101,8 @@ export interface ServerParsedArgs {
102+
@@ -100,6 +102,8 @@ export interface ServerParsedArgs {
103103
/* ----- code-server ----- */
104104
'disable-update-check'?: boolean;
105105
'auth'?: string;
@@ -112,9 +112,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
112112
===================================================================
113113
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
114114
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
115-
@@ -335,6 +335,8 @@ export class WebClientServer {
116-
serverBasePath: this._basePath,
117-
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
115+
@@ -366,6 +366,8 @@ export class WebClientServer {
116+
serverBasePath: basePath,
117+
webviewEndpoint: vscodeBase + staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
118118
userDataPath: this._environmentService.userDataPath,
119119
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
120120
+ isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
@@ -240,10 +240,10 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
240240
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
241241
@IPathService protected readonly pathService: IPathService,
242242
@IKeybindingService private readonly keybindingService: IKeybindingService,
243-
@@ -283,20 +283,22 @@ export class SimpleFileDialog extends Di
244-
this.filePickBox.sortByLabel = false;
243+
@@ -284,20 +284,22 @@ export class SimpleFileDialog extends Di
245244
this.filePickBox.ignoreFocusOut = true;
246245
this.filePickBox.ok = true;
246+
this.filePickBox.okLabel = this.options.openLabel;
247247
- if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
248248
- this.filePickBox.customButton = true;
249249
- this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');

patches/getting-started.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
2828
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
2929
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
3030
import './gettingStartedColors.js';
31-
@@ -834,6 +834,72 @@ export class GettingStartedPage extends
31+
@@ -869,6 +869,72 @@ export class GettingStartedPage extends
3232
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
3333
);
3434

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

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

190190
/* ----- server setup ----- */
191191

192-
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
192+
@@ -104,6 +105,7 @@ export interface ServerParsedArgs {
193193
'auth'?: string;
194194
'disable-file-downloads'?: boolean;
195195
'disable-file-uploads'?: boolean;
@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
201201
===================================================================
202202
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
203203
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
204-
@@ -339,6 +339,7 @@ export class WebClientServer {
204+
@@ -370,6 +370,7 @@ export class WebClientServer {
205205
userDataPath: this._environmentService.userDataPath,
206206
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
207207
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],

patches/integration.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
113113
===================================================================
114114
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
115115
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
116-
@@ -78,8 +78,11 @@ export class BrowserDialogHandler extend
116+
@@ -77,8 +77,11 @@ export class BrowserDialogHandler extend
117117

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

@@ -269,7 +269,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
269269
===================================================================
270270
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
271271
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
272-
@@ -308,6 +308,7 @@ export class WebClientServer {
272+
@@ -334,6 +334,7 @@ export class WebClientServer {
273273
} : undefined;
274274

275275
const productConfiguration = {

patches/local-storage.diff

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
1818
===================================================================
1919
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
2020
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
21-
@@ -330,6 +330,7 @@ export class WebClientServer {
21+
@@ -361,6 +361,7 @@ export class WebClientServer {
2222
remoteAuthority,
23-
serverBasePath: this._basePath,
24-
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
23+
serverBasePath: basePath,
24+
webviewEndpoint: vscodeBase + staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
2525
+ userDataPath: this._environmentService.userDataPath,
2626
_wrapWebWorkerExtHostInIframe,
2727
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
@@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
6666
===================================================================
6767
--- code-server.orig/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
6868
+++ code-server/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
69-
@@ -145,8 +145,10 @@ export class WorkspaceService extends Di
69+
@@ -147,8 +147,10 @@ export class WorkspaceService extends Di
7070
this.workspaceConfiguration = this._register(new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService));
7171
this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => {
7272
this.onWorkspaceConfigurationChanged(fromCache).then(() => {
@@ -79,7 +79,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
7979
});
8080
}));
8181

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

patches/logout.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
2828

2929
/* ----- server setup ----- */
3030

31-
@@ -97,6 +98,7 @@ export const serverOptions: OptionDescri
31+
@@ -98,6 +99,7 @@ export const serverOptions: OptionDescri
3232
export interface ServerParsedArgs {
3333
/* ----- code-server ----- */
3434
'disable-update-check'?: boolean;
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
4040
===================================================================
4141
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
4242
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
43-
@@ -313,6 +313,7 @@ export class WebClientServer {
43+
@@ -344,6 +344,7 @@ export class WebClientServer {
4444
codeServerVersion: this._productService.codeServerVersion,
4545
rootEndpoint: base,
4646
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,

0 commit comments

Comments
 (0)