@@ -6,7 +6,11 @@ import { getSupportedRuntimes, isSupportedRuntime, isNodejs, isPython } from '..
6
6
import { serverlessCommands , serverlessConfigs } from '../utils/constants' ;
7
7
import { isNotEmpty , checkExistsWithTimeout } from '../utils/file' ;
8
8
import { 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' ;
10
14
import { recordPageView } from '../utils/visitor' ;
11
15
import { ServiceResource } from '../models/resource' ;
12
16
import { TemplateService } from '../services/TemplateService' ;
@@ -37,7 +41,8 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
37
41
label : 'HTTP' ,
38
42
description : 'HTTP Trigger' ,
39
43
} ] ;
40
- const customRuntimeTemplates : vscode . QuickPickItem [ ] = getSupportedCustomRuntimeTemplates ( ) . map ( label => < vscode . QuickPickItem > { label } ) ;
44
+ const customRuntimeTemplates : vscode . QuickPickItem [ ] =
45
+ getSupportedCustomRuntimeTemplates ( ) . map ( label => < vscode . QuickPickItem > { label } ) ;
41
46
42
47
const runtimes : vscode . QuickPickItem [ ] = getSupportedRuntimes ( ) . map ( label => < vscode . QuickPickItem > { label } ) ;
43
48
@@ -162,9 +167,9 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
162
167
async function validateCreateFuncionState ( state : State ) : Promise < boolean > {
163
168
const functionTypes = [ 'NORMAL' , 'HTTP' ] ;
164
169
if ( ! state || ! state . serviceName
165
- || ! state . functionName
170
+ || ! state . functionName
166
171
|| ( ! isCustomRuntime ( state . runtime ) && ! functionTypes . includes ( state . type ) )
167
- || ! isSupportedRuntime ( state . runtime )
172
+ || ! isSupportedRuntime ( state . runtime )
168
173
|| ( isCustomRuntime ( state . runtime ) && ! isSupportedCustomRuntimeTemplates ( state . functionTemplate ) ) ) {
169
174
return false ;
170
175
}
@@ -194,7 +199,7 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
194
199
await createCodeFile ( type , runtime , codeUriPath ) ;
195
200
}
196
201
}
197
-
202
+
198
203
const state = await collectFuncInfo ( ) ;
199
204
if ( ! await validateCreateFuncionState ( state ) ) {
200
205
return ;
0 commit comments