From fea0c3ce46d212456201d653edc2506607a10ece Mon Sep 17 00:00:00 2001 From: Nora Date: Tue, 20 Jun 2023 15:01:40 +0000 Subject: [PATCH] Add icon --- extensions/ql-vscode/package.json | 14 ++++++++++++++ .../src/queries-panel/query-tree-view-item.ts | 9 +++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index ef20b1381..b47b7a824 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -501,6 +501,11 @@ "command": "codeQL.copyVersion", "title": "CodeQL: Copy Version Information" }, + { + "command": "codeQLQueries.runLocalQueryContextInline", + "title": "Run local query", + "icon": "$(run)" + }, { "command": "codeQLVariantAnalysisRepositories.openConfigFile", "title": "Open database configuration file", @@ -1095,6 +1100,11 @@ "group": "1_queryHistory@1", "when": "viewItem == remoteResultsItem" }, + { + "command": "codeQLQueries.runLocalQueryContextInline", + "group": "inline", + "when": "view == codeQLQueries && viewItem == queryFile" + }, { "command": "codeQLTests.showOutputDifferences", "group": "qltest@1", @@ -1274,6 +1284,10 @@ "command": "codeQL.openDataExtensionsEditor", "when": "config.codeQL.canary && config.codeQL.dataExtensions.editor" }, + { + "command": "codeQLQueries.runLocalQueryContextInline", + "when": "false" + }, { "command": "codeQLVariantAnalysisRepositories.openConfigFile", "when": "false" diff --git a/extensions/ql-vscode/src/queries-panel/query-tree-view-item.ts b/extensions/ql-vscode/src/queries-panel/query-tree-view-item.ts index 8a14f8018..41d50d8de 100644 --- a/extensions/ql-vscode/src/queries-panel/query-tree-view-item.ts +++ b/extensions/ql-vscode/src/queries-panel/query-tree-view-item.ts @@ -9,16 +9,17 @@ export class QueryTreeViewItem extends vscode.TreeItem { ) { super(name); this.tooltip = path; - this.description = language; - this.collapsibleState = this.children.length - ? vscode.TreeItemCollapsibleState.Collapsed - : vscode.TreeItemCollapsibleState.None; if (this.children.length === 0) { + this.description = language; + this.collapsibleState = vscode.TreeItemCollapsibleState.None; + this.contextValue = "queryFile"; this.command = { title: "Open", command: "vscode.open", arguments: [vscode.Uri.file(path)], }; + } else { + this.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed; } } }