@@ -36,14 +36,13 @@ import { restartFunctionApp } from './commands/restartFunctionApp';
3636import { startFunctionApp } from './commands/startFunctionApp' ;
3737import { stopFunctionApp } from './commands/stopFunctionApp' ;
3838import { ext } from './extensionVariables' ;
39- import { getTemplateDataFromBackup , tryGetLatestTemplateData , tryGetTemplateDataFromCache } from './templates/TemplateData' ;
39+ import { getTemplateData } from './templates/TemplateData' ;
4040import { FunctionAppProvider } from './tree/FunctionAppProvider' ;
4141import { FunctionAppTreeItem } from './tree/FunctionAppTreeItem' ;
4242import { FunctionTreeItem } from './tree/FunctionTreeItem' ;
4343import { ProxyTreeItem } from './tree/ProxyTreeItem' ;
4444import { dotnetUtils } from './utils/dotnetUtils' ;
4545import { functionRuntimeUtils } from './utils/functionRuntimeUtils' ;
46- import { cliFeedJsonResponse , getCliFeedJson } from './utils/getCliFeedJson' ;
4746
4847export function activate ( context : vscode . ExtensionContext ) : void {
4948 let reporter : TelemetryReporter | undefined ;
@@ -83,7 +82,7 @@ export function activate(context: vscode.ExtensionContext): void {
8382 await validateFunctionProjects ( this , ui , outputChannel , event . added ) ;
8483 } ) ;
8584
86- const templateDataTask : Promise < void > = getTemplateData ( reporter , context ) ;
85+ const templateDataTask : Promise < void > = getTemplateDataTask ( context ) ;
8786
8887 actionHandler . registerCommand ( 'azureFunctions.selectSubscriptions' , ( ) => vscode . commands . executeCommand ( 'azure-account.selectSubscriptions' ) ) ;
8988 actionHandler . registerCommand ( 'azureFunctions.refresh' , async ( node ?: IAzureNode ) => await tree . refresh ( node ) ) ;
@@ -125,10 +124,8 @@ export function activate(context: vscode.ExtensionContext): void {
125124 } ) ;
126125}
127126
128- async function getTemplateData ( reporter : TelemetryReporter | undefined , context : vscode . ExtensionContext ) : Promise < void > {
129- const cliFeedJson : cliFeedJsonResponse = await getCliFeedJson ( ) ;
130- // tslint:disable-next-line:strict-boolean-expressions
131- ext . templateData = await tryGetTemplateDataFromCache ( reporter , context . globalState , cliFeedJson ) || await tryGetLatestTemplateData ( reporter , cliFeedJson , context . globalState ) || await getTemplateDataFromBackup ( reporter , cliFeedJson ) ;
127+ async function getTemplateDataTask ( context : vscode . ExtensionContext ) : Promise < void > {
128+ ext . templateData = await getTemplateData ( context . globalState ) ;
132129}
133130
134131// tslint:disable-next-line:no-empty
0 commit comments