Skip to content

Commit 4e827ff

Browse files
committed
Feedback
1 parent c04aec6 commit 4e827ff

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,9 @@
382382
},
383383
{
384384
"id": "gitpod-flex-help",
385-
"name": "Help",
386-
"icon": "$(squirrel)"
385+
"name": "Looking for Gitpod Flex?",
386+
"icon": "$(squirrel)",
387+
"when": "gitpod.host === 'https://gitpod.io'"
387388
}
388389
]
389390
},
@@ -395,7 +396,7 @@
395396
},
396397
{
397398
"view": "gitpod-flex-help",
398-
"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/). This view is only to manage [Gitpod Classic](https://gitpod.io/workspaces) workspaces."
399+
"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."
399400
}
400401
]
401402
},

src/services/hostService.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class HostService extends Disposable implements IHostService {
3838
super();
3939

4040
this._gitpodHost = Configuration.getGitpodHost();
41+
this.updateGitpodHostContextKey();
4142

4243
this._register(vscode.workspace.onDidChangeConfiguration(e => {
4344
if (e.affectsConfiguration('gitpod.host')) {
@@ -50,12 +51,22 @@ export class HostService extends Disposable implements IHostService {
5051
const newGitpodHost = Configuration.getGitpodHost();
5152
if (new URL(this._gitpodHost).host !== new URL(newGitpodHost).host) {
5253
this._gitpodHost = newGitpodHost;
54+
this.updateGitpodHostContextKey();
5355
this._onDidChangeHost.fire();
5456
}
5557
}
5658
}));
5759
}
5860

61+
private updateGitpodHostContextKey() {
62+
try {
63+
const origin = new URL(this.gitpodHost).origin;
64+
vscode.commands.executeCommand('setContext', 'gitpod.host', origin);
65+
} catch (e) {
66+
vscode.commands.executeCommand('setContext', 'gitpod.host', undefined);
67+
}
68+
}
69+
5970
async changeHost(newHost: string, skipRemoteWindowCheck: boolean = false) {
6071
if (new URL(this._gitpodHost).host !== new URL(newHost).host) {
6172
const flow: UserFlowTelemetryProperties = { flow: 'changeHost', gitpodHost: newHost };

0 commit comments

Comments
 (0)