Skip to content

Commit

Permalink
greed lg parse (#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixzhan authored and a-b-r-o-w-n committed Dec 9, 2019
1 parent 7677101 commit 2cf35f1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Composer/packages/lib/indexers/src/lgIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}
Expand Down

0 comments on commit 2cf35f1

Please sign in to comment.