Skip to content

Commit f9cc079

Browse files
authored
Update Code to 1.76.1 (#6070)
* Update Code to 1.76.1 - worker-src already contains blob so we can avoid patching that. - localeService moved. - Remaining changes were just line changes. * Make language extensions installable again Still might want to look into making the native language support work but for now it seems better not to break backwards compatibility since the native implementation is quite different. * Avoid "install in browser" for language packs It will not work. * Import correct locale service I believe before the contributions imported this but now we have to do it here.
1 parent be40eca commit f9cc079

16 files changed

+113
-44
lines changed

lib/vscode

Submodule vscode updated 1057 files

patches/base-path.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
174174
+ `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=';`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
175175
'child-src \'self\';',
176176
`frame-src 'self' https://*.vscode-cdn.net data:;`,
177-
'worker-src \'self\' data:;',
177+
'worker-src \'self\' data: blob:;',
178178
@@ -417,3 +421,70 @@ export class WebClientServer {
179179
return void res.end(data);
180180
}
@@ -250,7 +250,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
250250
===================================================================
251251
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
252252
+++ code-server/lib/vscode/src/vs/base/common/product.ts
253-
@@ -32,6 +32,7 @@ export type ExtensionVirtualWorkspaceSup
253+
@@ -33,6 +33,7 @@ export type ExtensionVirtualWorkspaceSup
254254

255255
export interface IProductConfiguration {
256256
readonly codeServerVersion?: string
@@ -290,7 +290,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
290290
-import { RemoteAuthorities } from 'vs/base/common/network';
291291
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
292292

293-
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
293+
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
294294
@@ -75,7 +74,7 @@ export abstract class AbstractExtensionR
295295
public getExtensionGalleryResourceURL(galleryExtension: { publisher: string; name: string; version: string }, path?: string): URI | undefined {
296296
if (this._extensionGalleryResourceUrlTemplate) {

patches/disable-downloads.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
1212
===================================================================
1313
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
1414
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
15-
@@ -266,6 +266,11 @@ export interface IWorkbenchConstructionO
15+
@@ -260,6 +260,11 @@ export interface IWorkbenchConstructionO
1616
*/
1717
readonly userDataPath?: string
1818

@@ -172,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
172172
===================================================================
173173
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
174174
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
175-
@@ -32,6 +32,8 @@ export const IsFullscreenContext = new R
175+
@@ -33,6 +33,8 @@ export const IsFullscreenContext = new R
176176

177177
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
178178

patches/display-language.diff

+90-12
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ We can remove this once upstream supports all language packs.
1414
one but is worse because it does not handle non-existent or empty files.
1515
7. Replace some caching and Node requires because code-server does not restart
1616
when changing the language unlike native Code.
17+
8. Make language extensions installable like normal rather than using the
18+
special set/clear language actions.
1719

1820
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
1921
===================================================================
2022
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
2123
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
22-
@@ -220,6 +220,9 @@ export async function setupServerService
24+
@@ -234,6 +234,9 @@ export async function setupServerService
2325
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
2426
socketServer.registerChannel('extensions', channel);
2527

@@ -138,7 +140,7 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
138140
===================================================================
139141
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
140142
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
141-
@@ -30,6 +30,12 @@ export function getNLSConfiguration(lang
143+
@@ -32,6 +32,12 @@ export function getNLSConfiguration(lang
142144
if (InternalNLSConfiguration.is(value)) {
143145
value._languagePackSupport = true;
144146
}
@@ -151,7 +153,7 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
151153
return value;
152154
});
153155
_cache.set(key, result);
154-
@@ -44,3 +50,43 @@ export namespace InternalNLSConfiguratio
156+
@@ -46,3 +52,43 @@ export namespace InternalNLSConfiguratio
155157
return candidate && typeof candidate._languagePackId === 'string';
156158
}
157159
}
@@ -248,6 +250,15 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
248250
===================================================================
249251
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
250252
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
253+
@@ -52,7 +52,7 @@ import 'vs/workbench/services/dialogs/br
254+
import 'vs/workbench/services/host/browser/browserHostService';
255+
import 'vs/workbench/services/lifecycle/browser/lifecycleService';
256+
import 'vs/workbench/services/clipboard/browser/clipboardService';
257+
-import 'vs/workbench/services/localization/browser/localeService';
258+
+import 'vs/workbench/services/localization/electron-sandbox/localeService';
259+
import 'vs/workbench/services/path/browser/pathService';
260+
import 'vs/workbench/services/themes/browser/browserHostColorSchemeService';
261+
import 'vs/workbench/services/encryption/browser/encryptionService';
251262
@@ -119,8 +119,9 @@ import 'vs/workbench/contrib/logs/browse
252263
// Explorer
253264
import 'vs/workbench/contrib/files/browser/files.web.contribution';
@@ -264,9 +275,9 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
264275
===================================================================
265276
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
266277
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
267-
@@ -6,18 +6,24 @@
278+
@@ -5,18 +5,24 @@
279+
268280
import { CancellationTokenSource } from 'vs/base/common/cancellation';
269-
import { Language } from 'vs/base/common/platform';
270281
import { URI } from 'vs/base/common/uri';
271282
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
272283
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
@@ -289,20 +300,20 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
289300
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'))
290301
}
291302

292-
async getBuiltInExtensionTranslationsUri(id: string): Promise<URI | undefined> {
293-
@@ -73,6 +79,6 @@ export class WebLanguagePacksService ext
303+
async getBuiltInExtensionTranslationsUri(id: string, language: string): Promise<URI | undefined> {
304+
@@ -72,6 +78,6 @@ export class WebLanguagePacksService ext
294305

295306
// Web doesn't have a concept of language packs, so we just return an empty array
296307
getInstalledLanguages(): Promise<ILanguagePackItem[]> {
297308
- return Promise.resolve([]);
298309
+ return this.languagePackService.getInstalledLanguages()
299310
}
300311
}
301-
Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
312+
Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
302313
===================================================================
303-
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
304-
+++ code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
305-
@@ -41,7 +41,8 @@ export class NativeLocaleService impleme
314+
--- code-server.orig/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
315+
+++ code-server/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
316+
@@ -51,7 +51,8 @@ class NativeLocaleService implements ILo
306317
@IProductService private readonly productService: IProductService
307318
) { }
308319

@@ -312,7 +323,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
312323
try {
313324
const content = await this.textFileService.read(this.environmentService.argvResource, { encoding: 'utf8' });
314325

315-
@@ -68,9 +69,6 @@ export class NativeLocaleService impleme
326+
@@ -78,9 +79,6 @@ class NativeLocaleService implements ILo
316327
}
317328

318329
private async writeLocaleValue(locale: string | undefined): Promise<boolean> {
@@ -322,3 +333,70 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
322333
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
323334
return true;
324335
}
336+
Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
337+
===================================================================
338+
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
339+
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
340+
@@ -318,9 +318,6 @@ export abstract class AbstractInstallAct
341+
if (this.extension.isBuiltin) {
342+
return;
343+
}
344+
- if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
345+
- return;
346+
- }
347+
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
348+
this.enabled = this.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
349+
this.updateLabel();
350+
@@ -697,7 +694,7 @@ export abstract class InstallInOtherServ
351+
}
352+
353+
if (isLanguagePackExtension(this.extension.local.manifest)) {
354+
- return true;
355+
+ return false;
356+
}
357+
358+
// Prefers to run on UI
359+
@@ -1785,17 +1782,6 @@ export class SetLanguageAction extends E
360+
update(): void {
361+
this.enabled = false;
362+
this.class = SetLanguageAction.DisabledClass;
363+
- if (!this.extension) {
364+
- return;
365+
- }
366+
- if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
367+
- return;
368+
- }
369+
- if (this.extension.gallery && language === getLocale(this.extension.gallery)) {
370+
- return;
371+
- }
372+
- this.enabled = true;
373+
- this.class = SetLanguageAction.EnabledClass;
374+
}
375+
376+
override async run(): Promise<any> {
377+
@@ -1812,7 +1798,6 @@ export class ClearLanguageAction extends
378+
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
379+
380+
constructor(
381+
- @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
382+
@ILocaleService private readonly localeService: ILocaleService,
383+
) {
384+
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
385+
@@ -1822,17 +1807,6 @@ export class ClearLanguageAction extends
386+
update(): void {
387+
this.enabled = false;
388+
this.class = ClearLanguageAction.DisabledClass;
389+
- if (!this.extension) {
390+
- return;
391+
- }
392+
- if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
393+
- return;
394+
- }
395+
- if (this.extension.gallery && language !== getLocale(this.extension.gallery)) {
396+
- return;
397+
- }
398+
- this.enabled = true;
399+
- this.class = ClearLanguageAction.EnabledClass;
400+
}
401+
402+
override async run(): Promise<any> {

patches/getting-started.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
143143
===================================================================
144144
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
145145
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
146-
@@ -271,6 +271,11 @@ export interface IWorkbenchConstructionO
146+
@@ -265,6 +265,11 @@ export interface IWorkbenchConstructionO
147147
*/
148148
readonly isEnabledFileDownloads?: boolean
149149

@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
201201
'auth'?: string
202202
'disable-file-downloads'?: boolean;
203203
'locale'?: string
204-
+ 'disable-getting-started-override'?: boolean;
204+
+ 'disable-getting-started-override'?: boolean,
205205

206206
/* ----- server setup ----- */
207207

@@ -242,7 +242,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
242242
===================================================================
243243
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
244244
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
245-
@@ -33,6 +33,7 @@ export const IsFullscreenContext = new R
245+
@@ -34,6 +34,7 @@ export const IsFullscreenContext = new R
246246
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
247247

248248
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);

patches/integration.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
107107
===================================================================
108108
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
109109
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
110-
@@ -145,8 +145,11 @@ export class BrowserDialogHandler implem
110+
@@ -76,8 +76,11 @@ export class BrowserDialogHandler extend
111111

112112
async about(): Promise<void> {
113113
const detailString = (useAgo: boolean): string => {
@@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
198198
===================================================================
199199
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
200200
+++ code-server/lib/vscode/src/vs/base/common/product.ts
201-
@@ -31,6 +31,8 @@ export type ExtensionVirtualWorkspaceSup
201+
@@ -32,6 +32,8 @@ export type ExtensionVirtualWorkspaceSup
202202
};
203203

204204
export interface IProductConfiguration {

patches/local-storage.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
3232
===================================================================
3333
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
3434
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
35-
@@ -261,6 +261,11 @@ export interface IWorkbenchConstructionO
35+
@@ -255,6 +255,11 @@ export interface IWorkbenchConstructionO
3636
*/
3737
readonly configurationDefaults?: Record<string, any>;
3838

patches/logout.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
88
===================================================================
99
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
1010
+++ code-server/lib/vscode/src/vs/base/common/product.ts
11-
@@ -34,6 +34,7 @@ export interface IProductConfiguration {
11+
@@ -35,6 +35,7 @@ export interface IProductConfiguration {
1212
readonly codeServerVersion?: string
1313
readonly rootEndpoint?: string
1414
readonly updateEndpoint?: string

patches/marketplace.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
7575
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
7676
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
7777

78-
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
78+
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
7979

8080
@@ -60,7 +59,7 @@ export abstract class AbstractExtensionR
8181
private readonly _environmentService: IEnvironmentService,

patches/proposed-api.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstra
1010
===================================================================
1111
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
1212
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
13-
@@ -1486,7 +1486,7 @@ class ProposedApiController {
13+
@@ -1488,7 +1488,7 @@ class ProposedApiController {
1414

1515
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
1616

patches/proxy-uri.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
3030
===================================================================
3131
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
3232
+++ code-server/lib/vscode/src/vs/base/common/product.ts
33-
@@ -35,6 +35,7 @@ export interface IProductConfiguration {
33+
@@ -36,6 +36,7 @@ export interface IProductConfiguration {
3434
readonly rootEndpoint?: string
3535
readonly updateEndpoint?: string
3636
readonly logoutEndpoint?: string

patches/service-worker.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
66
===================================================================
77
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
88
+++ code-server/lib/vscode/src/vs/base/common/product.ts
9-
@@ -36,6 +36,10 @@ export interface IProductConfiguration {
9+
@@ -37,6 +37,10 @@ export interface IProductConfiguration {
1010
readonly updateEndpoint?: string
1111
readonly logoutEndpoint?: string
1212
readonly proxyEndpointTemplate?: string

patches/sourcemaps.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
1010
===================================================================
1111
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
1212
+++ code-server/lib/vscode/build/gulpfile.reh.js
13-
@@ -192,8 +192,7 @@ function packageTask(type, platform, arc
13+
@@ -191,8 +191,7 @@ function packageTask(type, platform, arc
1414

1515
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
1616
.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
2020

2121
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
2222
const isUIExtension = (manifest) => {
23-
@@ -232,9 +231,9 @@ function packageTask(type, platform, arc
23+
@@ -231,9 +230,9 @@ function packageTask(type, platform, arc
2424
.map(name => `.build/extensions/${name}/**`);
2525

2626
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
@@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
3232

3333
let version = packageJson.version;
3434
const quality = product.quality;
35-
@@ -389,7 +388,7 @@ function tweakProductForServerWeb(produc
35+
@@ -388,7 +387,7 @@ function tweakProductForServerWeb(produc
3636
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
3737
optimizeTask,
3838
util.rimraf(`out-vscode-${type}-min`),

patches/telemetry.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
2020
import { NullPolicyService } from 'vs/platform/policy/common/policy';
2121
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
2222
import { LoggerService } from 'vs/platform/log/node/loggerService';
23-
@@ -142,10 +143,13 @@ export async function setupServerService
24-
const machineId = await getMachineId();
23+
@@ -151,10 +152,13 @@ export async function setupServerService
24+
let oneDsAppender: ITelemetryAppender = NullAppender;
2525
const isInternal = isInternalTelemetry(productService, configurationService);
2626
if (supportsTelemetry(productService, environmentService)) {
2727
- if (productService.aiConfig && productService.aiConfig.ariaKey) {

patches/update-check.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
9393
===================================================================
9494
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
9595
+++ code-server/lib/vscode/src/vs/base/common/product.ts
96-
@@ -33,6 +33,7 @@ export type ExtensionVirtualWorkspaceSup
96+
@@ -34,6 +34,7 @@ export type ExtensionVirtualWorkspaceSup
9797
export interface IProductConfiguration {
9898
readonly codeServerVersion?: string
9999
readonly rootEndpoint?: string

0 commit comments

Comments
 (0)