-
Notifications
You must be signed in to change notification settings - Fork 26.2k
ICU source spans and type checking #39072
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
Conversation
fb3dc09
to
55d481b
Compare
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.
Nice tidy PR!
['Icu:Var', 'nestedVar'], | ||
['Icu:Var', 'item.var'], | ||
['Icu:Placeholder', '{{nestedPlaceholder}}'], |
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.
This seems a strange ordering. What is the algorithm for this?
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.
I was surprised too! I didn't deep dive into it, but the nested ICU had been collapsed into the outer ICU datastructure where nestedVar
comes before item.var
in the list of vars
, surprisingly.
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.
LGTM, just one proposal to add tests for nested ICUs. Thanks @JoostK 👍
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.
LGTM for language service
Prior to this change, expressions within ICUs would have a source span corresponding with the whole ICU. This commit narrows down the source spans of these expressions to the exact location in the source file, as a prerequisite for reporting type check errors within these expressions.
This commit adds tests for locating expressions within ICU expressions.
Expressions within ICU expressions in templates were not previously type-checked, as they were skipped while traversing the elements within a template. This commit enables type checking of these expressions by actually visiting the expressions. BREAKING CHANGE: Expressions within ICUs are now type-checked again, fixing a regression in Ivy. This may cause compilation failures if errors are found in expressions that appear within an ICU. Please correct these expressions to resolve the type-check errors. Fixes angular#39064
This commit adds tests for locating expressions within ICU expressions. PR Close #39072
Expressions within ICU expressions in templates were not previously type-checked, as they were skipped while traversing the elements within a template. This commit enables type checking of these expressions by actually visiting the expressions. BREAKING CHANGE: Expressions within ICUs are now type-checked again, fixing a regression in Ivy. This may cause compilation failures if errors are found in expressions that appear within an ICU. Please correct these expressions to resolve the type-check errors. Fixes #39064 PR Close #39072
@JoostK in the company we're using pug with Changing one template throws a lot of errors from nowhere I'm wondering what's happening :( |
@matheo that is unrelated to this change, as this only landed on master (for v11) and only affects type-checking, not parsing. The issue you're seeing is angular/angular-cli#18290, where the forked type-checker process does not use Webpack, so any custom loader is disregarded. Disabling the forked type checker should do the trick, although I'm not sure why you only started seeing problems now as this has been the case for a while. |
@JoostK I was aware of the not so pertinent comment, |
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. |
See individual commits.