@@ -33,7 +33,7 @@ export async function generateProjectWizard() {
33
33
}
34
34
35
35
const state : Partial < ProjectGenState > = {
36
- totalSteps : 7 + ( apiCapabilities . canExcludeSampleCode ? 1 : 0 )
36
+ totalSteps : 7 + ( apiCapabilities . supportsNoCodeParameter || apiCapabilities . supportsNoExamplesParameter ? 1 : 0 )
37
37
} ;
38
38
39
39
async function collectInputs ( state : Partial < ProjectGenState > ) {
@@ -149,18 +149,18 @@ export async function generateProjectWizard() {
149
149
} ) ;
150
150
return ( input : MultiStepInput ) => ExtensionsPicker . createExtensionsPicker (
151
151
input , state , { showLastUsed : true , showRequiredExtensions : true , allowZeroExtensions : true } ,
152
- ( apiCapabilities . canExcludeSampleCode ? inputGenerateSampleCode : undefined ) ) ;
152
+ ( apiCapabilities . supportsNoCodeParameter || apiCapabilities . supportsNoExamplesParameter ? inputGenerateSampleCode : undefined ) ) ;
153
153
}
154
154
155
155
async function inputGenerateSampleCode ( input : MultiStepInput , state : Partial < ProjectGenState > ) {
156
- const YES : string = ' Include sample code' ;
157
- const NO : string = ' Do not include sample code' ;
156
+ const YES : string = ` Include ${ apiCapabilities . supportsNoCodeParameter ? 'starter' : 'example' } code` ;
157
+ const NO : string = ` Do not include ${ apiCapabilities . supportsNoCodeParameter ? 'starter' : 'example' } code` ;
158
158
const quickPickItems : QuickPickItem [ ] = [
159
- { label : YES , picked : true } ,
160
- { label : NO }
159
+ { label : YES , picked : true } ,
160
+ { label : NO }
161
161
] ;
162
162
163
- state . isGenerateSampleCode = ( await input . showQuickPick < QuickPickItem , QuickPickParameters < QuickPickItem > > ( {
163
+ state . shouldGenerateCode = ( await input . showQuickPick < QuickPickItem , QuickPickParameters < QuickPickItem > > ( {
164
164
title : INPUT_TITLE ,
165
165
placeholder : 'Should sample code be included? Additional dependencies may be added along with the sample.' ,
166
166
step : input . getStepNumber ( ) ,
@@ -176,7 +176,7 @@ export async function generateProjectWizard() {
176
176
const projectGenState : ProjectGenState = state as ProjectGenState ;
177
177
saveDefaults ( projectGenState ) ;
178
178
deleteFolderIfExists ( getNewProjectDirectory ( projectGenState ) ) ;
179
- await downloadAndSetupProject ( projectGenState ) ;
179
+ await downloadAndSetupProject ( projectGenState , apiCapabilities ) ;
180
180
}
181
181
182
182
async function getTargetDirectory ( projectName : string ) {
@@ -249,9 +249,9 @@ function getNewProjectDirectory(state: ProjectGenState): Uri {
249
249
return Uri . file ( path . join ( state . targetDir . fsPath , state . artifactId ) ) ;
250
250
}
251
251
252
- async function downloadAndSetupProject ( state : ProjectGenState ) : Promise < void > {
252
+ async function downloadAndSetupProject ( state : ProjectGenState , codeQuarkusFunctionality : CodeQuarkusFunctionality ) : Promise < void > {
253
253
const projectDir : Uri = getNewProjectDirectory ( state ) ;
254
- const zip : ZipFile = await downloadProject ( state ) ;
254
+ const zip : ZipFile = await downloadProject ( state , codeQuarkusFunctionality ) ;
255
255
zip . on ( 'end' , ( ) => {
256
256
openProject ( projectDir ) ;
257
257
} ) ;
0 commit comments