77 window ,
88 workspace ,
99} from "vscode" ;
10- import { commandRunner , UserCancellationException } from "../../commandRunner" ;
10+ import { UserCancellationException } from "../../commandRunner" ;
1111import {
1212 getNwoFromGitHubUrl ,
1313 isValidGitHubNwo ,
@@ -32,6 +32,7 @@ import { getGitHubUrl } from "./db-tree-view-item-action";
3232import { getControllerRepo } from "../../variant-analysis/run-remote-query" ;
3333import { getErrorMessage } from "../../pure/helpers-pure" ;
3434import { Credentials } from "../../common/authentication" ;
35+ import { DatabasePanelCommands } from "../../common/commands" ;
3536
3637export interface RemoteDatabaseQuickPickItem extends QuickPickItem {
3738 kind : string ;
@@ -72,58 +73,28 @@ export class DbPanel extends DisposableObject {
7273 this . push ( this . treeView ) ;
7374 }
7475
75- public async initialize ( ) : Promise < void > {
76- this . push (
77- commandRunner ( "codeQLVariantAnalysisRepositories.openConfigFile" , ( ) =>
78- this . openConfigFile ( ) ,
79- ) ,
80- ) ;
81- this . push (
82- commandRunner ( "codeQLVariantAnalysisRepositories.addNewDatabase" , ( ) =>
83- this . addNewRemoteDatabase ( ) ,
84- ) ,
85- ) ;
86- this . push (
87- commandRunner ( "codeQLVariantAnalysisRepositories.addNewList" , ( ) =>
88- this . addNewList ( ) ,
89- ) ,
90- ) ;
91- this . push (
92- commandRunner (
93- "codeQLVariantAnalysisRepositories.setSelectedItem" ,
94- ( treeViewItem : DbTreeViewItem ) => this . setSelectedItem ( treeViewItem ) ,
95- ) ,
96- ) ;
97- this . push (
98- commandRunner (
99- "codeQLVariantAnalysisRepositories.setSelectedItemContextMenu" ,
100- ( treeViewItem : DbTreeViewItem ) => this . setSelectedItem ( treeViewItem ) ,
101- ) ,
102- ) ;
103- this . push (
104- commandRunner (
105- "codeQLVariantAnalysisRepositories.openOnGitHubContextMenu" ,
106- ( treeViewItem : DbTreeViewItem ) => this . openOnGitHub ( treeViewItem ) ,
107- ) ,
108- ) ;
109- this . push (
110- commandRunner (
111- "codeQLVariantAnalysisRepositories.renameItemContextMenu" ,
112- ( treeViewItem : DbTreeViewItem ) => this . renameItem ( treeViewItem ) ,
113- ) ,
114- ) ;
115- this . push (
116- commandRunner (
117- "codeQLVariantAnalysisRepositories.removeItemContextMenu" ,
118- ( treeViewItem : DbTreeViewItem ) => this . removeItem ( treeViewItem ) ,
119- ) ,
120- ) ;
121- this . push (
122- commandRunner (
123- "codeQLVariantAnalysisRepositories.setupControllerRepository" ,
124- ( ) => this . setupControllerRepository ( ) ,
125- ) ,
126- ) ;
76+ public getCommands ( ) : DatabasePanelCommands {
77+ return {
78+ "codeQLVariantAnalysisRepositories.openConfigFile" :
79+ this . openConfigFile . bind ( this ) ,
80+ "codeQLVariantAnalysisRepositories.addNewDatabase" :
81+ this . addNewRemoteDatabase . bind ( this ) ,
82+ "codeQLVariantAnalysisRepositories.addNewList" :
83+ this . addNewList . bind ( this ) ,
84+ "codeQLVariantAnalysisRepositories.setupControllerRepository" :
85+ this . setupControllerRepository . bind ( this ) ,
86+
87+ "codeQLVariantAnalysisRepositories.setSelectedItem" :
88+ this . setSelectedItem . bind ( this ) ,
89+ "codeQLVariantAnalysisRepositories.setSelectedItemContextMenu" :
90+ this . setSelectedItem . bind ( this ) ,
91+ "codeQLVariantAnalysisRepositories.openOnGitHubContextMenu" :
92+ this . openOnGitHub . bind ( this ) ,
93+ "codeQLVariantAnalysisRepositories.renameItemContextMenu" :
94+ this . renameItem . bind ( this ) ,
95+ "codeQLVariantAnalysisRepositories.removeItemContextMenu" :
96+ this . removeItem . bind ( this ) ,
97+ } ;
12798 }
12899
129100 private async openConfigFile ( ) : Promise < void > {
0 commit comments