From 2cf35f115149e9b1db28b13af08f6b1b2a67f4db Mon Sep 17 00:00:00 2001 From: Zhixiang Zhan Date: Tue, 10 Dec 2019 02:52:05 +0800 Subject: [PATCH] greed lg parse (#1733) --- Composer/packages/lib/indexers/src/lgIndexer.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Composer/packages/lib/indexers/src/lgIndexer.ts b/Composer/packages/lib/indexers/src/lgIndexer.ts index 1c6fe50d25..d33107bf7f 100644 --- a/Composer/packages/lib/indexers/src/lgIndexer.ts +++ b/Composer/packages/lib/indexers/src/lgIndexer.ts @@ -58,14 +58,11 @@ function index(files: FileInfo[]): LgFile[] { const id = getBaseName(name, '.lg'); const diagnostics = check(content, id); let templates: LgTemplate[] = []; - if (isValid(diagnostics)) { - try { - templates = parse(file.content, ''); - } catch (err) { - diagnostics.push(new Diagnostic(err.message, id, DiagnosticSeverity.Error)); - } + try { + templates = parse(file.content, ''); + } catch (err) { + diagnostics.push(new Diagnostic(err.message, id, DiagnosticSeverity.Error)); } - lgFiles.push({ id, relativePath, content, templates, diagnostics }); } }