Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions extensions/ql-vscode/src/query-testing/qltest-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ export class QLTestDiscovery extends Discovery {
super("QL Test Discovery", extLogger);

this.push(this.watcher.onDidChange(this.handleDidChange, this));

// Watch for changes to any `.ql` or `.qlref` file in any of the QL packs that contain tests.
this.watcher.addWatch(
new RelativePattern(this.workspaceFolder.uri.fsPath, "**/*.{ql,qlref}"),
);
// need to explicitly watch for changes to directories themselves.
this.watcher.addWatch(
new RelativePattern(this.workspaceFolder.uri.fsPath, "**/"),
);
}

/**
Expand All @@ -56,15 +65,6 @@ export class QLTestDiscovery extends Discovery {
protected async discover() {
this._testDirectory = await this.discoverTests();

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(this.workspaceFolder.uri.fsPath, "**/*.{ql,qlref}"),
);
// need to explicitly watch for changes to directories themselves.
this.watcher.addWatch(
new RelativePattern(this.workspaceFolder.uri.fsPath, "**/"),
);
this._onDidChangeTests.fire(undefined);
}

Expand Down