@@ -59,6 +59,8 @@ function getOtherStudioActionLabel(action: OtherStudioAction): string {
59
59
return label ;
60
60
}
61
61
62
+ const suppressEditListenerMap = new Map < string , boolean > ( ) ;
63
+
62
64
class StudioActions {
63
65
private uri : vscode . Uri ;
64
66
private api : AtelierAPI ;
@@ -86,10 +88,6 @@ class StudioActions {
86
88
outputChannel . appendLine ( errorText ) ;
87
89
outputChannel . show ( ) ;
88
90
}
89
- if ( userAction . reload ) {
90
- const document = vscode . window . activeTextEditor . document ;
91
- loadChanges ( [ currentFile ( document ) ] ) ;
92
- }
93
91
if ( config ( ) . studioActionDebugOutput ) {
94
92
outputChannel . appendLine ( JSON . stringify ( userAction ) ) ;
95
93
}
@@ -267,6 +265,13 @@ class StudioActions {
267
265
}
268
266
const actionToProcess = data . result . content . pop ( ) ;
269
267
268
+ if ( actionToProcess . reload ) {
269
+ const document = vscode . window . activeTextEditor . document ;
270
+ const file = currentFile ( document ) ;
271
+ suppressEditListenerMap . set ( file . uri . toString ( ) , true ) ;
272
+ await loadChanges ( [ file ] ) ;
273
+ }
274
+
270
275
// CSP pages should not have a progress bar
271
276
if ( actionToProcess . action === 2 ) {
272
277
resolve ( ) ;
@@ -359,6 +364,10 @@ class StudioActions {
359
364
label : getOtherStudioActionLabel ( action ) ,
360
365
} ;
361
366
if ( action === OtherStudioAction . AttemptedEdit ) {
367
+ if ( suppressEditListenerMap . has ( this . uri . toString ( ) ) ) {
368
+ suppressEditListenerMap . delete ( this . uri . toString ( ) ) ;
369
+ return ;
370
+ }
362
371
const query = "select * from %Atelier_v1_Utils.Extension_GetStatus(?)" ;
363
372
this . api . actionQuery ( query , [ this . name ] ) . then ( ( statusObj ) => {
364
373
const docStatus = statusObj . result . content . pop ( ) ;
0 commit comments