@@ -71,7 +71,7 @@ function promptRuntime(metadataManager: MetadataManager, pattern: string | undef
7171 {
7272 title : localize ( 'AWS.serverlessLand.initWizard.runtime.prompt' , 'Select Runtime' ) ,
7373 placeholder : 'Choose a runtime for your project' ,
74- buttons : [ vscode . QuickInputButtons . Back ] ,
74+ buttons : createCommonButtons ( ) ,
7575 }
7676 )
7777}
@@ -94,24 +94,30 @@ function promptIac(metadataManager: MetadataManager, pattern: string | undefined
9494 {
9595 title : localize ( 'AWS.serverlessLand.initWizard.iac.prompt' , 'Select IaC' ) ,
9696 placeholder : 'Choose an IaC option for your project' ,
97- buttons : [ vscode . QuickInputButtons . Back ] ,
97+ buttons : createCommonButtons ( ) ,
9898 }
9999 )
100100}
101101
102102function promptLocation ( ) {
103103 return createFolderPrompt ( vscode . workspace . workspaceFolders ?? [ ] , {
104104 title : localize ( 'AWS.serverlessLand.initWizard.location.prompt' , 'Select Project Location' ) ,
105- buttons : [ vscode . QuickInputButtons . Back ] ,
106- browseFolderDetail : 'Select a folder for your project' ,
105+ buttons : createCommonButtons ( ) ,
106+ browseFolderDetail : 'Select a parent folder for your project' ,
107107 } )
108108}
109109
110- function promptName ( ) {
110+ function promptName ( location : vscode . Uri | undefined ) {
111+ let folderName : string
112+ if ( location ) {
113+ folderName = path . basename ( location . fsPath )
114+ } else {
115+ folderName = ''
116+ }
111117 return createInputBox ( {
112118 title : localize ( 'AWS.serverlessLand.initWizard.name.prompt' , 'Enter Project Name' ) ,
113- placeholder : ' Enter a name for your new application' ,
114- buttons : [ vscode . QuickInputButtons . Back ] ,
119+ placeholder : ` ${ folderName } /: Enter a name for your new application` ,
120+ buttons : createCommonButtons ( ) ,
115121 validateInput : ( value : string ) : string | undefined => {
116122 if ( ! value ) {
117123 return 'Application name cannot be empty'
@@ -140,6 +146,6 @@ export class CreateServerlessLandWizard extends Wizard<CreateServerlessLandWizar
140146 this . form . runtime . bindPrompter ( ( state ) => promptRuntime ( this . metadataManager , state . pattern ) )
141147 this . form . iac . bindPrompter ( ( state ) => promptIac ( this . metadataManager , state . pattern ) )
142148 this . form . location . bindPrompter ( ( ) => promptLocation ( ) )
143- this . form . name . bindPrompter ( ( ) => promptName ( ) )
149+ this . form . name . bindPrompter ( ( state ) => promptName ( state . location ) )
144150 }
145151}
0 commit comments