Skip to content

Commit 17561cb

Browse files
committed
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.
1 parent 8889059 commit 17561cb

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

patches/display-language.diff

+52
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ 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
===================================================================
@@ -322,3 +324,53 @@ Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-sa
322324
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
323325
return true;
324326
}
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+
@@ -1822,17 +1808,6 @@ export class ClearLanguageAction extends
360+
update(): void {
361+
this.enabled = false;
362+
this.class = ClearLanguageAction.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 = ClearLanguageAction.EnabledClass;
374+
}
375+
376+
override async run(): Promise<any> {

0 commit comments

Comments
 (0)