@@ -597,7 +597,9 @@ function activate(context) {
597
597
async function ( ) {
598
598
//Get workspace folder
599
599
if ( vscode . workspace . workspaceFolders . length == 0 ) {
600
- vscode . window . showErrorMessage ( 'Open a folder!' ) ;
600
+ vscode . window . showErrorMessage (
601
+ 'Open a folder in your workspace!'
602
+ ) ;
601
603
return ;
602
604
}
603
605
let workspacefolderUri = undefined ;
@@ -609,7 +611,7 @@ function activate(context) {
609
611
let choice = undefined ;
610
612
await vscode . window
611
613
. showQuickPick ( wsfList , {
612
- placeHolder : 'Select a workspace folder:' ,
614
+ placeHolder : 'Select a folder:' ,
613
615
} )
614
616
. then (
615
617
( value ) => {
@@ -640,8 +642,13 @@ function activate(context) {
640
642
let kind = undefined ;
641
643
await vscode . window
642
644
. showQuickPick (
643
- [ 'Class' , 'Business Service' , 'Business Operation' ] ,
644
- { placeHolder : 'What do you want to generate?' }
645
+ [
646
+ 'Class' ,
647
+ 'Business Service' ,
648
+ 'Business Operation' ,
649
+ 'Message' ,
650
+ ] ,
651
+ { placeHolder : 'New' }
645
652
)
646
653
. then (
647
654
( value ) => {
@@ -654,6 +661,7 @@ function activate(context) {
654
661
}
655
662
) ;
656
663
if ( kind == undefined ) return ;
664
+ // get class name and package
657
665
let className = await vscode . window . showInputBox ( {
658
666
placeHolder : 'Class Name' ,
659
667
} ) ;
@@ -665,21 +673,29 @@ function activate(context) {
665
673
666
674
let text = undefined ;
667
675
668
- //class
669
- if ( kind == 'Class' ) {
670
- text = await wizard . createClass ( className , packageName ) ;
671
- }
672
- if ( kind == 'Business Service' ) {
673
- text = await wizard . createBusinessService (
674
- className ,
675
- packageName
676
- ) ;
677
- }
678
- if ( kind == 'Business Operation' ) {
679
- text = await wizard . createBusinessOperation (
680
- className ,
681
- packageName
682
- ) ;
676
+ // get the code
677
+ switch ( kind ) {
678
+ case 'Class' :
679
+ text = await wizard . createClass ( className , packageName ) ;
680
+ break ;
681
+ case 'Business Service' :
682
+ text = await wizard . createBusinessService (
683
+ className ,
684
+ packageName
685
+ ) ;
686
+ break ;
687
+ case 'Business Operation' :
688
+ text = await wizard . createBusinessOperation (
689
+ className ,
690
+ packageName
691
+ ) ;
692
+ break ;
693
+ case 'Message' :
694
+ text = await wizard . createMessage ( className , packageName ) ;
695
+ break ;
696
+ default :
697
+ vscode . window . showErrorMessage ( 'Something went wrong!' ) ;
698
+ return ;
683
699
}
684
700
685
701
if ( text == undefined ) return ;
0 commit comments