diff --git a/package.json b/package.json index 7c2aeea..3065d84 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Gitpod", "description": "Required to connect to Classic workspaces", "publisher": "gitpod", - "version": "0.0.180", + "version": "0.0.181", "license": "MIT", "icon": "resources/gitpod.png", "repository": { @@ -379,6 +379,12 @@ "name": "Workspace", "icon": "$(squirrel)", "when": "false" + }, + { + "id": "gitpod-flex-help", + "name": "Looking for Gitpod Flex?", + "icon": "$(squirrel)", + "when": "gitpod.host === 'https://gitpod.io'" } ] }, @@ -387,6 +393,10 @@ "view": "gitpod-login", "when": "gitpod.authenticated != true && !gitpod.inGitpodFlexRemoteWindow", "contents": "You have not yet signed in with Gitpod\n[Sign in](command:gitpod.signIn)" + }, + { + "view": "gitpod-flex-help", + "contents": "Connecting to Gitpod Flex environments requires installing the [Gitpod Flex extension](https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-flex) and opening them through the [Gitpod Flex](https://app.gitpod.io/).\nThis view is only to manage [Gitpod Classic](https://gitpod.io/workspaces) workspaces." } ] }, diff --git a/src/services/hostService.ts b/src/services/hostService.ts index 923c07e..9b72a9c 100644 --- a/src/services/hostService.ts +++ b/src/services/hostService.ts @@ -38,6 +38,7 @@ export class HostService extends Disposable implements IHostService { super(); this._gitpodHost = Configuration.getGitpodHost(); + this.updateGitpodHostContextKey(); this._register(vscode.workspace.onDidChangeConfiguration(e => { if (e.affectsConfiguration('gitpod.host')) { @@ -50,12 +51,22 @@ export class HostService extends Disposable implements IHostService { const newGitpodHost = Configuration.getGitpodHost(); if (new URL(this._gitpodHost).host !== new URL(newGitpodHost).host) { this._gitpodHost = newGitpodHost; + this.updateGitpodHostContextKey(); this._onDidChangeHost.fire(); } } })); } + private updateGitpodHostContextKey() { + try { + const origin = new URL(this.gitpodHost).origin; + vscode.commands.executeCommand('setContext', 'gitpod.host', origin); + } catch (e) { + vscode.commands.executeCommand('setContext', 'gitpod.host', undefined); + } + } + async changeHost(newHost: string, skipRemoteWindowCheck: boolean = false) { if (new URL(this._gitpodHost).host !== new URL(newHost).host) { const flow: UserFlowTelemetryProperties = { flow: 'changeHost', gitpodHost: newHost };