diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 37cce6bfdbc..43ebd9058d9 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Ensure changes in directories that contain tests will be properly updated in the test explorer. [#846](https://github.com/github/vscode-codeql/pull/846) + ## 1.4.7 - 23 April 2021 - Fix a bug that prevented the results view from being loaded. [#842](https://github.com/github/vscode-codeql/pull/842) diff --git a/extensions/ql-vscode/src/qltest-discovery.ts b/extensions/ql-vscode/src/qltest-discovery.ts index 0cda0be3d80..31bd9bf7d0a 100644 --- a/extensions/ql-vscode/src/qltest-discovery.ts +++ b/extensions/ql-vscode/src/qltest-discovery.ts @@ -167,9 +167,11 @@ export class QLTestDiscovery extends Discovery { protected update(results: QLTestDiscoveryResults): void { this._testDirectory = results.testDirectory; - // Watch for changes to any `.ql` or `.qlref` file in any of the QL packs that contain tests. this.watcher.clear(); + // Watch for changes to any `.ql` or `.qlref` file in any of the QL packs that contain tests. this.watcher.addWatch(new RelativePattern(results.watchPath, '**/*.{ql,qlref}')); + // need to explicitly watch for changes to directories themselves. + this.watcher.addWatch(new RelativePattern(results.watchPath, '**/')); this._onDidChangeTests.fire(); }