Skip to content

Commit b8c5e29

Browse files
committed
added pendingDeletes
1 parent 4466309 commit b8c5e29

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,17 @@ export class PromptsService extends Disposable implements IPromptsService {
9696
this.promptFileByCommandCache.clear();
9797
}
9898
else {
99-
// Clear cache for prompt files that match the changed URI
99+
// Clear cache for prompt files that match the changed URI\
100+
const pendingDeletes: string[] = [];
100101
for (const [key, value] of this.promptFileByCommandCache) {
101102
if (isEqual(value.value?.uri, event.uri)) {
102-
this.promptFileByCommandCache.delete(key);
103+
pendingDeletes.push(key);
103104
}
104105
}
106+
107+
for (const key of pendingDeletes) {
108+
this.promptFileByCommandCache.delete(key);
109+
}
105110
}
106111

107112
this.onDidChangeParsedPromptFilesCacheEmitter.fire();

0 commit comments

Comments
 (0)