Skip to content

Commit dc5efce

Browse files
committed
Watch for changes in directory structure
This ensures that directories renamed, added or deleted are properly checked to see if they contain tests. The test tree will be correctly updated when any directory changes.s
1 parent f6c67bf commit dc5efce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/ql-vscode/src/qltest-discovery.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ export class QLTestDiscovery extends Discovery<QLTestDiscoveryResults> {
167167
protected update(results: QLTestDiscoveryResults): void {
168168
this._testDirectory = results.testDirectory;
169169

170-
// Watch for changes to any `.ql` or `.qlref` file in any of the QL packs that contain tests.
171170
this.watcher.clear();
171+
// Watch for changes to any `.ql` or `.qlref` file in any of the QL packs that contain tests.
172172
this.watcher.addWatch(new RelativePattern(results.watchPath, '**/*.{ql,qlref}'));
173+
// need to explicitly watch for changes to directories themselves.
174+
this.watcher.addWatch(new RelativePattern(results.watchPath, '**/'));
173175
this._onDidChangeTests.fire();
174176
}
175177

0 commit comments

Comments
 (0)