11import type { CommandManager } from "../packages/commands" ;
2- import type { Uri } from "vscode" ;
2+ import type { Uri , Range } from "vscode" ;
33import type { DbTreeViewItem } from "../databases/ui/db-tree-view-item" ;
44import type { DatabaseItem } from "../local-databases" ;
55import type { QueryHistoryInfo } from "../query-history/query-history-info" ;
@@ -31,6 +31,21 @@ export type BaseCommands = {
3131 "codeQL.restartQueryServer" : ( ) => Promise < void > ;
3232} ;
3333
34+ // Commands used for running local queries
35+ export type LocalQueryCommands = {
36+ "codeQL.runQuery" : ( uri ?: Uri ) => Promise < void > ;
37+ "codeQL.runQueryContextEditor" : ( uri ?: Uri ) => Promise < void > ;
38+ "codeQL.runQueryOnMultipleDatabases" : ( uri ?: Uri ) => Promise < void > ;
39+ "codeQL.runQueryOnMultipleDatabasesContextEditor" : (
40+ uri ?: Uri ,
41+ ) => Promise < void > ;
42+ "codeQL.runQueries" : SelectionCommandFunction < Uri > ;
43+ "codeQL.quickEval" : ( uri : Uri ) => Promise < void > ;
44+ "codeQL.quickEvalContextEditor" : ( uri : Uri ) => Promise < void > ;
45+ "codeQL.codeLensQuickEval" : ( uri : Uri , range : Range ) => Promise < void > ;
46+ "codeQL.quickQuery" : ( ) => Promise < void > ;
47+ } ;
48+
3449// Commands used for the query history panel
3550export type QueryHistoryCommands = {
3651 // Commands in the "navigation" group
@@ -65,27 +80,42 @@ export type QueryHistoryCommands = {
6580
6681// Commands used for the local databases panel
6782export type LocalDatabasesCommands = {
68- "codeQL.setCurrentDatabase" : ( uri : Uri ) => Promise < void > ;
69- "codeQL.setDefaultTourDatabase" : ( ) => Promise < void > ;
83+ // Command palette commands
84+ "codeQL.chooseDatabaseFolder" : ( ) => Promise < void > ;
85+ "codeQL.chooseDatabaseArchive" : ( ) => Promise < void > ;
86+ "codeQL.chooseDatabaseInternet" : ( ) => Promise < void > ;
87+ "codeQL.chooseDatabaseGithub" : ( ) => Promise < void > ;
7088 "codeQL.upgradeCurrentDatabase" : ( ) => Promise < void > ;
7189 "codeQL.clearCache" : ( ) => Promise < void > ;
7290
91+ // Explorer context menu
92+ "codeQL.setCurrentDatabase" : ( uri : Uri ) => Promise < void > ;
93+
94+ // Database panel view title commands
7395 "codeQLDatabases.chooseDatabaseFolder" : ( ) => Promise < void > ;
7496 "codeQLDatabases.chooseDatabaseArchive" : ( ) => Promise < void > ;
7597 "codeQLDatabases.chooseDatabaseInternet" : ( ) => Promise < void > ;
7698 "codeQLDatabases.chooseDatabaseGithub" : ( ) => Promise < void > ;
99+ "codeQLDatabases.sortByName" : ( ) => Promise < void > ;
100+ "codeQLDatabases.sortByDateAdded" : ( ) => Promise < void > ;
101+
102+ // Database panel context menu
77103 "codeQLDatabases.setCurrentDatabase" : (
78104 databaseItem : DatabaseItem ,
79105 ) => Promise < void > ;
80- "codeQLDatabases.sortByName" : ( ) => Promise < void > ;
81- "codeQLDatabases.sortByDateAdded" : ( ) => Promise < void > ;
82- "codeQLDatabases.removeOrphanedDatabases" : ( ) => Promise < void > ;
83106
107+ // Database panel selection commands
84108 "codeQLDatabases.removeDatabase" : SelectionCommandFunction < DatabaseItem > ;
85109 "codeQLDatabases.upgradeDatabase" : SelectionCommandFunction < DatabaseItem > ;
86110 "codeQLDatabases.renameDatabase" : SelectionCommandFunction < DatabaseItem > ;
87111 "codeQLDatabases.openDatabaseFolder" : SelectionCommandFunction < DatabaseItem > ;
88112 "codeQLDatabases.addDatabaseSource" : SelectionCommandFunction < DatabaseItem > ;
113+
114+ // Codespace template commands
115+ "codeQL.setDefaultTourDatabase" : ( ) => Promise < void > ;
116+
117+ // Internal commands
118+ "codeQLDatabases.removeOrphanedDatabases" : ( ) => Promise < void > ;
89119} ;
90120
91121// Commands tied to variant analysis
@@ -110,10 +140,19 @@ export type DatabasePanelCommands = {
110140 "codeQLVariantAnalysisRepositories.removeItemContextMenu" : SingleSelectionCommandFunction < DbTreeViewItem > ;
111141} ;
112142
143+ export type EvalLogViewerCommands = {
144+ "codeQLEvalLogViewer.clear" : ( ) => Promise < void > ;
145+ } ;
146+
113147export type AllCommands = BaseCommands &
114148 QueryHistoryCommands &
115149 LocalDatabasesCommands &
116150 VariantAnalysisCommands &
117- DatabasePanelCommands ;
151+ DatabasePanelCommands &
152+ EvalLogViewerCommands ;
118153
119154export type AppCommandManager = CommandManager < AllCommands > ;
155+
156+ // Separate command manager because it uses a different logger
157+ export type QueryServerCommands = LocalQueryCommands ;
158+ export type QueryServerCommandManager = CommandManager < QueryServerCommands > ;
0 commit comments