Skip to content

Commit 65b471f

Browse files
Feat: microsoft#132598 Add notification in case of running a translated build on windows and macOS (microsoft#181191)
* added notification in case of running a rosetta translated build * using app.runningUnderARM64Translation instead of system call * added download button to the download page in the wrong build notification * removed test call * Update src/vs/workbench/electron-sandbox/window.ts Co-authored-by: Robo <[email protected]> * Update src/vs/workbench/electron-sandbox/window.ts Co-authored-by: Robo <[email protected]> * code format * Update src/vs/workbench/electron-sandbox/window.ts Co-authored-by: Robo <[email protected]> --------- Co-authored-by: Robo <[email protected]>
1 parent 8c85702 commit 65b471f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/vs/code/electron-main/app.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,11 @@ export class CodeApplication extends Disposable {
12511251

12521252
// Crash reporter
12531253
this.updateCrashReporterEnablement();
1254+
1255+
if (app.runningUnderARM64Translation) {
1256+
this.windowsMainService?.sendToFocused('vscode:showTranslatedBuildWarning');
1257+
}
1258+
12541259
}
12551260

12561261
private async installMutex(): Promise<void> {

src/vs/workbench/electron-sandbox/window.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,29 @@ export class NativeWindow extends Disposable {
228228
);
229229
});
230230

231+
ipcRenderer.on('vscode:showTranslatedBuildWarning', (event: unknown, message: string) => {
232+
this.notificationService.prompt(
233+
Severity.Warning,
234+
localize("runningTranslated", "You are running an emulated version of {0}. For better performance download the native arm64 version of {0} build for your machine.", this.productService.nameLong),
235+
[{
236+
label: localize('downloadArmBuild', "Download"),
237+
run: () => {
238+
const quality = this.productService.quality;
239+
let stableURL = '';
240+
let insidersURL = '';
241+
if (isMacintosh) {
242+
stableURL = 'https://code.visualstudio.com/docs/?dv=osx';
243+
insidersURL = 'https://code.visualstudio.com/docs/?dv=osx&build=insiders';
244+
} else if (isWindows) {
245+
stableURL = 'https://code.visualstudio.com/docs/?dv=win32arm64user';
246+
insidersURL = 'https://code.visualstudio.com/docs/?dv=win32arm64user&build=insiders';
247+
}
248+
this.openerService.open(quality === 'stable' ? stableURL : insidersURL);
249+
}
250+
}]
251+
);
252+
});
253+
231254
// Fullscreen Events
232255
ipcRenderer.on('vscode:enterFullScreen', async () => { setFullscreen(true); });
233256
ipcRenderer.on('vscode:leaveFullScreen', async () => { setFullscreen(false); });

0 commit comments

Comments
 (0)