Skip to content

Commit 5d45a11

Browse files
authored
Merge pull request #3510 from github/aeisenberg/flush-archive-files
Flush archive file systems when removed
2 parents ccd5313 + e939750 commit 5d45a11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

extensions/ql-vscode/src/common/vscode/archive-filesystem-provider.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,17 @@ export class ArchiveFileSystemProvider implements FileSystemProvider {
242242

243243
root = new Directory("");
244244

245+
constructor() {
246+
// When a file system archive is removed from the workspace, we should
247+
// also remove it from our cache.
248+
workspace.onDidChangeWorkspaceFolders((event) => {
249+
for (const removed of event.removed) {
250+
const zipPath = removed.uri.fsPath;
251+
this.archives.delete(zipPath);
252+
}
253+
});
254+
}
255+
245256
// metadata
246257

247258
async stat(uri: Uri): Promise<FileStat> {

0 commit comments

Comments
 (0)