File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ function getOtherStudioActionLabel(action: OtherStudioAction): string {
59
59
return label ;
60
60
}
61
61
62
+ // Used to avoid triggering the edit listener when files are reloaded by an extension
62
63
const suppressEditListenerMap = new Map < string , boolean > ( ) ;
63
64
64
65
class StudioActions {
@@ -268,6 +269,7 @@ class StudioActions {
268
269
if ( actionToProcess . reload ) {
269
270
const document = vscode . window . activeTextEditor . document ;
270
271
const file = currentFile ( document ) ;
272
+ // Avoid the reload triggering the edit listener here
271
273
suppressEditListenerMap . set ( file . uri . toString ( ) , true ) ;
272
274
await loadChanges ( [ file ] ) ;
273
275
}
@@ -364,6 +366,8 @@ class StudioActions {
364
366
label : getOtherStudioActionLabel ( action ) ,
365
367
} ;
366
368
if ( action === OtherStudioAction . AttemptedEdit ) {
369
+ // Check to see if this "attempted edit" was an action by this extension due to a reload.
370
+ // There's no way to detect at a higher level from the event.
367
371
if ( suppressEditListenerMap . has ( this . uri . toString ( ) ) ) {
368
372
suppressEditListenerMap . delete ( this . uri . toString ( ) ) ;
369
373
return ;
You can’t perform that action at this time.
0 commit comments