Skip to content

Commit 7b99bdf

Browse files
committed
Address review comments.
1 parent bb16454 commit 7b99bdf

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

extensions/ql-vscode/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,10 @@
493493
"command": "codeQLQueryHistory.showQueryText",
494494
"when": "false"
495495
},
496+
{
497+
"command": "codeQLQueryHistory.viewSarif",
498+
"when": "false"
499+
},
496500
{
497501
"command": "codeQLQueryHistory.setLabel",
498502
"when": "false"

extensions/ql-vscode/src/query-history.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class HistoryTreeDataProvider implements vscode.TreeDataProvider<CompletedQuery>
7474
constructor(private ctx: ExtensionContext) {
7575
}
7676

77-
getTreeItem(element: CompletedQuery): vscode.TreeItem {
77+
async getTreeItem(element: CompletedQuery): Promise<vscode.TreeItem> {
7878
const it = new vscode.TreeItem(element.toString());
7979

8080
it.command = {
@@ -86,7 +86,7 @@ class HistoryTreeDataProvider implements vscode.TreeDataProvider<CompletedQuery>
8686
// Mark this query history item according to whether it has a
8787
// SARIF file so that we can make context menu items conditionally
8888
// available.
89-
it.contextValue = element.query.hasInterpretedResults() ? 'interpretedResultsItem' : 'rawResultsItem';
89+
it.contextValue = await element.query.hasInterpretedResults() ? 'interpretedResultsItem' : 'rawResultsItem';
9090

9191
if (!element.didRunSuccessfully) {
9292
it.iconPath = path.join(this.ctx.extensionPath, FAILED_QUERY_HISTORY_ITEM_ICON);

extensions/ql-vscode/src/run-queries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export class QueryInfo {
170170
/**
171171
* Holds if this query actually has produced interpreted results.
172172
*/
173-
hasInterpretedResults(): boolean {
174-
return fs.existsSync(this.resultsPaths.interpretedResultsPath);
173+
async hasInterpretedResults(): Promise<boolean> {
174+
return fs.pathExists(this.resultsPaths.interpretedResultsPath);
175175
}
176176
}
177177

0 commit comments

Comments
 (0)