Skip to content

Commit 08ccb14

Browse files
committed
Commet a bit
1 parent 61b9bc8 commit 08ccb14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/commands/studio.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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
6263
const suppressEditListenerMap = new Map<string, boolean>();
6364

6465
class 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;

0 commit comments

Comments
 (0)