@@ -7,23 +7,25 @@ import { getMRUrl } from './utils/repo';
7
7
import ACTIONS , { dispatch } from './utils/actions' ;
8
8
import { IDepot , IMRItem } from './typings/common' ;
9
9
10
+ const { registerCommand } = hx . commands ;
11
+
10
12
export function registerCommands ( context : IContext ) {
11
13
const { codingServer } = context ;
12
14
13
15
context . subscriptions . push (
14
- hx . commands . registerCommand ( 'codingPlugin.helloWorld' , ( ) => {
16
+ registerCommand ( 'codingPlugin.helloWorld' , ( ) => {
15
17
toast . info ( 'hello' ) ;
16
18
} ) ,
17
19
) ;
18
20
19
21
context . subscriptions . push (
20
- hx . commands . registerCommand ( 'codingPlugin.mrTreeItemClick' , function ( [ team , mrItem ] : [ string , IMRItem ] ) {
22
+ registerCommand ( 'codingPlugin.mrTreeItemClick' , function ( [ team , mrItem ] : [ string , IMRItem ] ) {
21
23
hx . env . openExternal ( getMRUrl ( team , mrItem ) ) ;
22
24
} ) ,
23
25
) ;
24
26
25
27
context . subscriptions . push (
26
- hx . commands . registerCommand ( 'codingPlugin.depotTreeItemClick' , function ( param : IDepot ) {
28
+ registerCommand ( 'codingPlugin.depotTreeItemClick' , function ( param : IDepot ) {
27
29
toast . info ( `选中仓库:${ param . name } ` ) ;
28
30
dispatch ( ACTIONS . SET_SELECTED_DEPOT , {
29
31
context,
@@ -33,7 +35,7 @@ export function registerCommands(context: IContext) {
33
35
) ;
34
36
35
37
context . subscriptions . push (
36
- hx . commands . registerCommand ( 'codingPlugin.createDepot' , async function ( param : any ) {
38
+ registerCommand ( 'codingPlugin.createDepot' , async function ( param : any ) {
37
39
const depot = await hx . window . showInputBox ( {
38
40
prompt : '请输入仓库名' ,
39
41
} ) ;
0 commit comments