Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: one lg template error mess up others #1733

Merged
merged 2 commits into from
Dec 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Contributor

@boydc2014 boydc2014 Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are fully aware that, there are some confusing and inconvenience how LG library provide features like validation and parsing, the core issue is parsing is not as tolerant as checker and CRUD functions.

Here is a thread in LG side, that we will consolidate the interface in LG side, and unify the experience, especially on error handling, microsoft/botbuilder-dotnet#3084.

Hopefully with this work, the code in Composer will be simplified significantly. Please take a look, and leave your opinions.

templates = parse(file.content, '');
} catch (err) {
diagnostics.push(new Diagnostic(err.message, id, DiagnosticSeverity.Error));
}

lgFiles.push({ id, relativePath, content, templates, diagnostics });
}
}
Expand Down