@@ -6,7 +6,11 @@ import { getSupportedRuntimes, isSupportedRuntime, isNodejs, isPython } from '..
66import { serverlessCommands , serverlessConfigs } from '../utils/constants' ;
77import { isNotEmpty , checkExistsWithTimeout } from '../utils/file' ;
88import { createCodeFile , isCustomRuntime } from '../utils/runtime' ;
9- import { getSupportedCustomRuntimeTemplates , isSupportedCustomRuntimeTemplates , createCustomRuntimeCodeFile } from '../utils/runtime' ;
9+ import {
10+ getSupportedCustomRuntimeTemplates ,
11+ isSupportedCustomRuntimeTemplates ,
12+ createCustomRuntimeCodeFile
13+ } from '../utils/runtime' ;
1014import { recordPageView } from '../utils/visitor' ;
1115import { ServiceResource } from '../models/resource' ;
1216import { TemplateService } from '../services/TemplateService' ;
@@ -37,7 +41,8 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
3741 label : 'HTTP' ,
3842 description : 'HTTP Trigger' ,
3943 } ] ;
40- const customRuntimeTemplates : vscode . QuickPickItem [ ] = getSupportedCustomRuntimeTemplates ( ) . map ( label => < vscode . QuickPickItem > { label } ) ;
44+ const customRuntimeTemplates : vscode . QuickPickItem [ ] =
45+ getSupportedCustomRuntimeTemplates ( ) . map ( label => < vscode . QuickPickItem > { label } ) ;
4146
4247 const runtimes : vscode . QuickPickItem [ ] = getSupportedRuntimes ( ) . map ( label => < vscode . QuickPickItem > { label } ) ;
4348
@@ -162,9 +167,9 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
162167 async function validateCreateFuncionState ( state : State ) : Promise < boolean > {
163168 const functionTypes = [ 'NORMAL' , 'HTTP' ] ;
164169 if ( ! state || ! state . serviceName
165- || ! state . functionName
170+ || ! state . functionName
166171 || ( ! isCustomRuntime ( state . runtime ) && ! functionTypes . includes ( state . type ) )
167- || ! isSupportedRuntime ( state . runtime )
172+ || ! isSupportedRuntime ( state . runtime )
168173 || ( isCustomRuntime ( state . runtime ) && ! isSupportedCustomRuntimeTemplates ( state . functionTemplate ) ) ) {
169174 return false ;
170175 }
@@ -194,7 +199,7 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
194199 await createCodeFile ( type , runtime , codeUriPath ) ;
195200 }
196201 }
197-
202+
198203 const state = await collectFuncInfo ( ) ;
199204 if ( ! await validateCreateFuncionState ( state ) ) {
200205 return ;
0 commit comments