-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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(compiler): do not throw away render3 AST on errors #39413
Conversation
Currently render3's `parseTemplate` throws away the parsed AST and returns an empty list of HTML nodes if HTML->R3 translation failed. This is not preferrable in some contexts like that of a language service, where we would like a well-formed AST even if it is has errors.
if (parseResult.errors && parseResult.errors.length > 0) { | ||
// TODO(ayazhafiz): we may not always want to bail out at this point (e.g. in | ||
// the context of a language service). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to do some more investigation to understand the consequences of trying to translate an ML AST with errors to R3. The language service will need this translation to happen even in the presence of errors, but my prediction is that the translation will emit even more, possibly overlapping or incorrect errors. Here is where @alxhub's idea of consolidating parsers becomes very attractive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's good to be careful here - we might hit assertion failures in the translator that throw
, not just additional errors.
Caretaker: can you run g3sync? |
Currently render3's `parseTemplate` throws away the parsed AST and returns an empty list of HTML nodes if HTML->R3 translation failed. This is not preferrable in some contexts like that of a language service, where we would like a well-formed AST even if it is has errors. PR Close #39413
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently render3's
parseTemplate
throws away the parsed AST andreturns an empty list of HTML nodes if HTML->R3 translation failed. This
is not preferrable in some contexts like that of a language service,
where we would like a well-formed AST even if it is has errors.