@@ -51,6 +51,7 @@ export class WorkspaceMonitor implements vscode.Disposable {
51
51
const newWorkspaceData = JSON . parse ( event . data ) as Workspace
52
52
if ( JSON . stringify ( this . lastData ) !== JSON . stringify ( newWorkspaceData ) ) {
53
53
this . update ( newWorkspaceData )
54
+ this . maybeNotify ( newWorkspaceData )
54
55
this . onChange . fire ( newWorkspaceData )
55
56
}
56
57
} catch ( error ) {
@@ -85,9 +86,13 @@ export class WorkspaceMonitor implements vscode.Disposable {
85
86
this . lastData = workspace
86
87
this . updateContext ( workspace )
87
88
this . updateStatusBar ( workspace )
89
+ }
90
+
91
+ private maybeNotify ( workspace : Workspace ) {
88
92
this . maybeNotifyOutdated ( workspace )
89
93
this . maybeNotifyAutostop ( workspace )
90
94
this . maybeNotifyDeletion ( workspace )
95
+ this . maybeNotifyNotRunning ( workspace )
91
96
}
92
97
93
98
private maybeNotifyAutostop ( workspace : Workspace ) {
@@ -115,6 +120,22 @@ export class WorkspaceMonitor implements vscode.Disposable {
115
120
}
116
121
}
117
122
123
+ private maybeNotifyNotRunning ( workspace : Workspace ) {
124
+ if ( workspace . latest_build . status !== "running" ) {
125
+ const action = vscode . window . showInformationMessage (
126
+ "Your workspace is no longer running!" ,
127
+ {
128
+ detail : "Reloading the window to reconnect." ,
129
+ } ,
130
+ "Reload Window" ,
131
+ )
132
+ if ( ! action ) {
133
+ return
134
+ }
135
+ vscode . commands . executeCommand ( "workbench.action.reloadWindow" )
136
+ }
137
+ }
138
+
118
139
private isImpending ( target : string , notifyTime : number ) : boolean {
119
140
const nowTime = new Date ( ) . getTime ( )
120
141
const targetTime = new Date ( target ) . getTime ( )
0 commit comments