Skip to content

Commit 84f60cc

Browse files
Avoid duplicate use of the codeQLQueryHistory.removeHistoryItem command
1 parent 019af98 commit 84f60cc

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

extensions/ql-vscode/package.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,17 @@
554554
"icon": "$(preview)"
555555
},
556556
{
557-
"command": "codeQLQueryHistory.removeHistoryItem",
557+
"command": "codeQLQueryHistory.removeHistoryItemTitleMenu",
558+
"title": "Delete",
559+
"icon": "$(trash)"
560+
},
561+
{
562+
"command": "codeQLQueryHistory.removeHistoryItemContextMenu",
563+
"title": "Delete",
564+
"icon": "$(trash)"
565+
},
566+
{
567+
"command": "codeQLQueryHistory.removeHistoryItemContextInline",
558568
"title": "Delete",
559569
"icon": "$(trash)"
560570
},
@@ -751,7 +761,7 @@
751761
"group": "navigation"
752762
},
753763
{
754-
"command": "codeQLQueryHistory.removeHistoryItem",
764+
"command": "codeQLQueryHistory.removeHistoryItemTitleMenu",
755765
"when": "view == codeQLQueryHistory",
756766
"group": "navigation"
757767
},
@@ -853,12 +863,12 @@
853863
"when": "view == codeQLQueryHistory"
854864
},
855865
{
856-
"command": "codeQLQueryHistory.removeHistoryItem",
866+
"command": "codeQLQueryHistory.removeHistoryItemContextMenu",
857867
"group": "7_queryHistory@0",
858868
"when": "viewItem == interpretedResultsItem || viewItem == rawResultsItem || viewItem == remoteResultsItem || viewItem == cancelledRemoteResultsItemWithoutLogs || viewItem == cancelledResultsItem || viewItem == cancelledRemoteResultsItem"
859869
},
860870
{
861-
"command": "codeQLQueryHistory.removeHistoryItem",
871+
"command": "codeQLQueryHistory.removeHistoryItemContextInline",
862872
"group": "inline",
863873
"when": "viewItem == interpretedResultsItem || viewItem == rawResultsItem || viewItem == remoteResultsItem || viewItem == cancelledRemoteResultsItemWithoutLogs || viewItem == cancelledResultsItem || viewItem == cancelledRemoteResultsItem"
864874
},
@@ -1159,7 +1169,15 @@
11591169
"when": "false"
11601170
},
11611171
{
1162-
"command": "codeQLQueryHistory.removeHistoryItem",
1172+
"command": "codeQLQueryHistory.removeHistoryItemTitleMenu",
1173+
"when": "false"
1174+
},
1175+
{
1176+
"command": "codeQLQueryHistory.removeHistoryItemContextMenu",
1177+
"when": "false"
1178+
},
1179+
{
1180+
"command": "codeQLQueryHistory.removeHistoryItemContextInline",
11631181
"when": "false"
11641182
},
11651183
{

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,19 @@ export class QueryHistoryManager extends DisposableObject {
210210
);
211211
this.push(
212212
commandRunner(
213-
"codeQLQueryHistory.removeHistoryItem",
213+
"codeQLQueryHistory.removeHistoryItemTitleMenu",
214+
this.handleRemoveHistoryItem.bind(this),
215+
),
216+
);
217+
this.push(
218+
commandRunner(
219+
"codeQLQueryHistory.removeHistoryItemContextMenu",
220+
this.handleRemoveHistoryItem.bind(this),
221+
),
222+
);
223+
this.push(
224+
commandRunner(
225+
"codeQLQueryHistory.removeHistoryItemContextInline",
214226
this.handleRemoveHistoryItem.bind(this),
215227
),
216228
);

0 commit comments

Comments
 (0)