@@ -14,6 +14,8 @@ We can remove this once upstream supports all language packs.
14
14
one but is worse because it does not handle non-existent or empty files.
15
15
7. Replace some caching and Node requires because code-server does not restart
16
16
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.
17
19
18
20
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
19
21
===================================================================
@@ -322,3 +324,61 @@ Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-sa
322
324
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
323
325
return true;
324
326
}
327
+ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
328
+ ===================================================================
329
+ --- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
330
+ +++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
331
+ @@ -318,9 +318,6 @@ export abstract class AbstractInstallAct
332
+ if (this.extension.isBuiltin) {
333
+ return;
334
+ }
335
+ - if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
336
+ - return;
337
+ - }
338
+ if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
339
+ this.enabled = this.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
340
+ this.updateLabel();
341
+ @@ -1785,17 +1782,6 @@ export class SetLanguageAction extends E
342
+ update(): void {
343
+ this.enabled = false;
344
+ this.class = SetLanguageAction.DisabledClass;
345
+ - if (!this.extension) {
346
+ - return;
347
+ - }
348
+ - if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
349
+ - return;
350
+ - }
351
+ - if (this.extension.gallery && language === getLocale(this.extension.gallery)) {
352
+ - return;
353
+ - }
354
+ - this.enabled = true;
355
+ - this.class = SetLanguageAction.EnabledClass;
356
+ }
357
+
358
+ override async run(): Promise<any> {
359
+ @@ -1812,7 +1798,6 @@ export class ClearLanguageAction extends
360
+ private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
361
+
362
+ constructor(
363
+ - @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
364
+ @ILocaleService private readonly localeService: ILocaleService,
365
+ ) {
366
+ super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
367
+ @@ -1822,17 +1807,6 @@ export class ClearLanguageAction extends
368
+ update(): void {
369
+ this.enabled = false;
370
+ this.class = ClearLanguageAction.DisabledClass;
371
+ - if (!this.extension) {
372
+ - return;
373
+ - }
374
+ - if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
375
+ - return;
376
+ - }
377
+ - if (this.extension.gallery && language !== getLocale(this.extension.gallery)) {
378
+ - return;
379
+ - }
380
+ - this.enabled = true;
381
+ - this.class = ClearLanguageAction.EnabledClass;
382
+ }
383
+
384
+ override async run(): Promise<any> {
0 commit comments