Skip to content

Commit 480acb8

Browse files
committed
Fix missing stopCurrentWorkspace command
1 parent e314e17 commit 480acb8

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,17 @@
155155
"icon": "$(primitive-square)"
156156
},
157157
{
158-
"command": "gitpod.workspaces.stopCurrentWorkspace",
158+
"command": "gitpod.workspaces.stopCurrentWorkspace_inline",
159159
"category": "Gitpod",
160160
"title": "Disconnect and Stop",
161161
"icon": "$(primitive-square)"
162162
},
163+
{
164+
"command": "gitpod.workspaces.stopCurrentWorkspace",
165+
"category": "Gitpod",
166+
"title": "Stop Current Workspace",
167+
"icon": "$(primitive-square)"
168+
},
163169
{
164170
"command": "gitpod.workspaces.openInBrowser",
165171
"category": "Gitpod",
@@ -224,7 +230,7 @@
224230
"group": "inline@3"
225231
},
226232
{
227-
"command": "gitpod.workspaces.stopCurrentWorkspace",
233+
"command": "gitpod.workspaces.stopCurrentWorkspace_inline",
228234
"when": "viewItem =~ /^gitpod-workspaces.workspace.+connected$/",
229235
"group": "inline@4"
230236
},
@@ -314,9 +320,13 @@
314320
"when": "false"
315321
},
316322
{
317-
"command": "gitpod.workspaces.stopCurrentWorkspace",
323+
"command": "gitpod.workspaces.stopCurrentWorkspace_inline",
318324
"when": "false"
319325
},
326+
{
327+
"command": "gitpod.workspaces.stopCurrentWorkspace",
328+
"when": "gitpod.authenticated == true && gitpod.inWorkspace == true"
329+
},
320330
{
321331
"command": "gitpod.workspaces.openInBrowser",
322332
"when": "gitpod.authenticated == true && gitpod.inWorkspace == true"

src/commands/workspaces.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export class StopWorkspaceCommandInline extends StopWorkspaceCommand {
490490
}
491491

492492
export class StopCurrentWorkspaceCommand implements Command {
493-
readonly id = 'gitpod.workspaces.stopCurrentWorkspace';
493+
readonly id: string = 'gitpod.workspaces.stopCurrentWorkspace';
494494

495495
constructor(
496496
private readonly workspaceId: string | undefined,
@@ -516,6 +516,19 @@ export class StopCurrentWorkspaceCommand implements Command {
516516
}
517517
}
518518

519+
export class StopCurrentWorkspaceCommandInline extends StopCurrentWorkspaceCommand {
520+
override readonly id = 'gitpod.workspaces.stopCurrentWorkspace_inline';
521+
522+
constructor(
523+
workspaceId: string | undefined,
524+
sessionService: ISessionService,
525+
hostService: IHostService,
526+
telemetryService: ITelemetryService,
527+
) {
528+
super(workspaceId, sessionService, hostService, telemetryService);
529+
}
530+
}
531+
519532
export class OpenInBrowserCommand implements Command {
520533
readonly id = 'gitpod.workspaces.openInBrowser';
521534

@@ -613,7 +626,7 @@ export class OpenWorkspaceContextCommand implements Command {
613626
return;
614627
}
615628

616-
const rawWsData = await this.sessionService.getAPI().getWorkspace(treeItem.id)
629+
const rawWsData = await this.sessionService.getAPI().getWorkspace(treeItem.id);
617630
const wsData = rawWorkspaceToWorkspaceData(await this.sessionService.getAPI().getWorkspace(treeItem.id));
618631

619632
// Report if we couldn't parse contextUrl

src/workspacesExplorerView.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getGitpodRemoteWindowConnectionInfo } from './remote';
1313
import { Barrier } from './common/async';
1414
import { ITelemetryService } from './common/telemetry';
1515
import { ILogService } from './services/logService';
16-
import { ConnectInCurrentWindowCommand, ConnectInNewWindowCommand, DeleteWorkspaceCommand, OpenWorkspaceContextCommand, OpenInBrowserCommand, StopCurrentWorkspaceCommand, StopWorkspaceCommand, DisconnectWorkspaceCommand, ConnectInCurrentWindowCommandInline, StopWorkspaceCommandInline, DeleteWorkspaceCommandContext, StopWorkspaceCommandContext, ConnectInCurrentWindowCommandContext, ConnectInNewWindowCommandContext, ConnectInCurrentWindowCommandContext_1, ConnectInCurrentWindowCommandInline_1 } from './commands/workspaces';
16+
import { ConnectInCurrentWindowCommand, ConnectInNewWindowCommand, DeleteWorkspaceCommand, OpenWorkspaceContextCommand, OpenInBrowserCommand, StopCurrentWorkspaceCommand, StopWorkspaceCommand, DisconnectWorkspaceCommand, ConnectInCurrentWindowCommandInline, StopWorkspaceCommandInline, DeleteWorkspaceCommandContext, StopWorkspaceCommandContext, ConnectInCurrentWindowCommandContext, ConnectInNewWindowCommandContext, ConnectInCurrentWindowCommandContext_1, ConnectInCurrentWindowCommandInline_1, StopCurrentWorkspaceCommandInline } from './commands/workspaces';
1717
import { IRemoteService } from './services/remoteService';
1818
import { IExperimentsService } from './experiments';
1919

@@ -114,6 +114,7 @@ export class WorkspacesExplorerView extends Disposable implements vscode.TreeDat
114114
commandManager.register(new StopWorkspaceCommandContext(sessionService, hostService, telemetryService));
115115
commandManager.register(new StopWorkspaceCommandInline(sessionService, hostService, telemetryService));
116116
commandManager.register(new StopCurrentWorkspaceCommand(this.connectedWorkspaceId, sessionService, hostService, telemetryService));
117+
commandManager.register(new StopCurrentWorkspaceCommandInline(this.connectedWorkspaceId, sessionService, hostService, telemetryService));
117118
commandManager.register(new OpenInBrowserCommand(sessionService, hostService, telemetryService));
118119
commandManager.register(new DeleteWorkspaceCommand(sessionService, hostService, telemetryService));
119120
commandManager.register(new DeleteWorkspaceCommandContext(sessionService, hostService, telemetryService));

0 commit comments

Comments
 (0)