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 {
5959 return label ;
6060}
6161
62+ // Used to avoid triggering the edit listener when files are reloaded by an extension
6263const suppressEditListenerMap = new Map < string , boolean > ( ) ;
6364
6465class StudioActions {
@@ -268,6 +269,7 @@ class StudioActions {
268269 if ( actionToProcess . reload ) {
269270 const document = vscode . window . activeTextEditor . document ;
270271 const file = currentFile ( document ) ;
272+ // Avoid the reload triggering the edit listener here
271273 suppressEditListenerMap . set ( file . uri . toString ( ) , true ) ;
272274 await loadChanges ( [ file ] ) ;
273275 }
@@ -364,6 +366,8 @@ class StudioActions {
364366 label : getOtherStudioActionLabel ( action ) ,
365367 } ;
366368 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.
367371 if ( suppressEditListenerMap . has ( this . uri . toString ( ) ) ) {
368372 suppressEditListenerMap . delete ( this . uri . toString ( ) ) ;
369373 return ;
You can’t perform that action at this time.
0 commit comments