Skip to content

Commit 5742fed

Browse files
akosyakovjeanp413
authored andcommitted
[web] snow open in desktop notifcation
1 parent c0bafbd commit 5742fed

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

extensions/gitpod-web/package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,17 @@
429429
"id": "github",
430430
"label": "GitHub"
431431
}
432-
]
432+
],
433+
"configuration": {
434+
"title": "Gitpod",
435+
"properties": {
436+
"gitpod.openInStable.neverPrompt": {
437+
"type": "boolean",
438+
"description": "Control whether to prompt to open in VS Code Desktop on page load.",
439+
"default": false
440+
}
441+
}
442+
}
433443
},
434444
"scripts": {
435445
"vscode:prepublish": "yarn run compile --cwd .."
@@ -444,4 +454,4 @@
444454
"vscode-jsonrpc": "^5.0.1",
445455
"vscode-nls": "^5.0.0"
446456
}
447-
}
457+
}

extensions/gitpod-web/src/extension.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export async function activate(context: vscode.ExtensionContext) {
2929
if (!gitpodContext) {
3030
return;
3131
}
32+
registerDesktop(gitpodContext);
3233
registerAuth(gitpodContext);
3334
registerPorts(gitpodContext);
3435
registerTasks(gitpodContext, (options, parentTerminal) => {
@@ -1077,3 +1078,18 @@ export function registerExtensionManagement(codeServer: GitpodCodeServer, contex
10771078
context.subscriptions.push(codeServer.onDidInstallExtension(() => validateGitpodFile()));
10781079
context.subscriptions.push(codeServer.onDidUninstallExtension(() => validateGitpodFile()));
10791080
}
1081+
1082+
export async function registerDesktop(_: GitpodExtensionContext): Promise<void> {
1083+
const config = vscode.workspace.getConfiguration('gitpod.openInStable');
1084+
if (config.get<boolean>('neverPrompt') === true) {
1085+
return;
1086+
}
1087+
const openAction = 'Open';
1088+
const neverAgain = 'Don\'t Show Again';
1089+
const action = await vscode.window.showInformationMessage('Do you want to open this workspace in VS Code Desktop?', openAction, neverAgain);
1090+
if (action === openAction) {
1091+
vscode.commands.executeCommand('gitpod.openInStable');
1092+
} else if (action === neverAgain) {
1093+
config.update('neverPrompt', true, true);
1094+
}
1095+
}

0 commit comments

Comments
 (0)