Skip to content

Commit d28ee6d

Browse files
authored
Merge branch 'main' into koesie10/unsupported-cli-version-check
2 parents 3e9b427 + 0f1f00d commit d28ee6d

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [UNRELEASED]
44

55
- Add settings `codeQL.variantAnalysis.defaultResultsFilter` and `codeQL.variantAnalysis.defaultResultsSort` for configuring how variant analysis results are filtered and sorted in the results view. The default is to show all repositories, and to sort by the number of results. [#2392](https://github.com/github/vscode-codeql/pull/2392)
6+
- Fix bug where the `CodeQL: Compare Query` command did not work for comparing quick-eval queries. [#2422](https://github.com/github/vscode-codeql/pull/2422)
67
- Add warning when using unsupported CodeQL CLI version. [#2428](https://github.com/github/vscode-codeql/pull/2428)
78

89
## 1.8.4 - 3 May 2023

extensions/ql-vscode/src/queries-panel/query-tree-data-provider.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ export class QueryTreeDataProvider
1717
private createTree(): QueryTreeViewItem[] {
1818
// Temporary mock data, just to populate the tree view.
1919
return [
20-
new QueryTreeViewItem("name1", "path1", []),
21-
new QueryTreeViewItem("name2", "path2", [
22-
new QueryTreeViewItem("name3", "path3", []),
23-
new QueryTreeViewItem("name4", "path4", [
24-
new QueryTreeViewItem("name5", "path5", []),
20+
new QueryTreeViewItem("custom-pack", [
21+
new QueryTreeViewItem("custom-pack/example.ql", []),
22+
]),
23+
new QueryTreeViewItem("ql", [
24+
new QueryTreeViewItem("ql/javascript", [
25+
new QueryTreeViewItem("ql/javascript/example.ql", []),
26+
]),
27+
new QueryTreeViewItem("ql/go", [
28+
new QueryTreeViewItem("ql/go/security", [
29+
new QueryTreeViewItem("ql/go/security/query1.ql", []),
30+
new QueryTreeViewItem("ql/go/security/query2.ql", []),
31+
]),
2532
]),
2633
]),
2734
];
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import * as vscode from "vscode";
2+
import { basename } from "path";
23

34
export class QueryTreeViewItem extends vscode.TreeItem {
4-
constructor(
5-
label: string,
6-
tooltip: string | undefined,
7-
public readonly children: QueryTreeViewItem[],
8-
) {
9-
super(label);
10-
this.tooltip = tooltip;
5+
constructor(path: string, public readonly children: QueryTreeViewItem[]) {
6+
super(basename(path));
7+
this.tooltip = path;
118
this.collapsibleState = this.children.length
129
? vscode.TreeItemCollapsibleState.Collapsed
1310
: vscode.TreeItemCollapsibleState.None;
11+
if (this.children.length === 0) {
12+
this.command = {
13+
title: "Open",
14+
command: "vscode.open",
15+
arguments: [vscode.Uri.file(path)],
16+
};
17+
}
1418
}
1519
}

0 commit comments

Comments
 (0)