33
44import { instrumentOperationStep , sendInfo } from "vscode-extension-telemetry-wrapper" ;
55import { serviceManager } from "../model" ;
6- import { BootVersion , MatadataType } from "../model/Metadata" ;
6+ import { BootVersion , MetadataType } from "../model/Metadata" ;
77import { IPickMetadata , IProjectMetadata , IStep } from "./HandlerInterfaces" ;
88import { SpecifyLanguageStep } from "./SpecifyLanguageStep" ;
99import { createPickBox } from "./utils" ;
@@ -29,13 +29,21 @@ export class SpecifyBootVersionStep implements IStep {
2929 }
3030
3131 private async specifyBootVersion ( projectMetadata : IProjectMetadata ) : Promise < boolean > {
32+ const items = await serviceManager . getItems ( projectMetadata . serviceUrl , MetadataType . BOOTVERSION ) ;
33+
34+ if ( projectMetadata . enableSmartDefaults === true ) {
35+ projectMetadata . bootVersion = items . find ( x => x . default === true ) ?. value ?. id ;
36+ return true ;
37+ }
38+
3239 const pickMetaData : IPickMetadata < BootVersion > = {
3340 metadata : projectMetadata ,
3441 title : "Spring Initializr: Specify Spring Boot version" ,
3542 pickStep : SpecifyBootVersionStep . getInstance ( ) ,
3643 placeholder : "Specify Spring Boot version." ,
37- items : serviceManager . getItems ( projectMetadata . serviceUrl , MatadataType . BOOTVERSION ) ,
44+ items : items ,
3845 } ;
46+
3947 return await createPickBox ( pickMetaData ) ;
4048 }
4149}
0 commit comments