Repository navigation
refactor(compiler-cli): add makeTemplateDiagnostic wrapper - #42937
danieltre23 wants to merge 1 commit into
Conversation
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
3777a11 to
e6ab28f
Compare
e6ab28f to
ffc7bd2
Compare
atscott
left a comment
There was a problem hiding this comment.
This is minor detail when working with the compiler:
We typically mark these as a refactor rather than feat because there's no publicly facing feature that can be used so we want to avoid adding this to the changelog.
|
I think you could also make the commit message a bit more clear in terms of what's going to be using this new method and defend why it's appropriate to be placed here (i.e. it makes sense for the template type checker to have this method because users of the Try to provide the whole context in your commit message so if someone were to look at this in isolation, it would still make sense. |
dgp1130
left a comment
There was a problem hiding this comment.
I agree with @atscott's comments, but looks good beyond that.
Apologies for the feat() commit message, that was my suggestion as I totally forgot that refactor() existed. Is there any recommendation for whether to target minor or patch with this? It's only needed in minor for future changes, but I'd rather not diverge patch more than we need to.
ffc7bd2 to
4f67cf5
Compare
We often merge these types of things to |
|
presubmit (unrelated failures, forcing green) |
|
Targetting patch to avoid unnecessary divergence per @atscott's comment. |
fa257c7 to
a1a2d90
Compare
a1a2d90 to
722e81f
Compare
Add a `makeTemplateDiagnostic` wrapper in the `TemplateTypeChecker`. This requiers less parameters to create template diagnostics, since the `TemplateTypeChecker` can get the templateId and mapping from it's scope with the `ts.ClassDeclartion`. The `TemplateTypeChecker` is often used to determine if a diagnostic should be produced, so it makes sense to have a function in it that helps create them. Refs angular#42966
722e81f to
f0960f3
Compare
Add a `makeTemplateDiagnostic` wrapper in the `TemplateTypeChecker`. This requiers less parameters to create template diagnostics, since the `TemplateTypeChecker` can get the templateId and mapping from it's scope with the `ts.ClassDeclartion`. The `TemplateTypeChecker` is often used to determine if a diagnostic should be produced, so it makes sense to have a function in it that helps create them. Refs #42966 PR Close #42937
|
This PR must be rolled back, as it caused the patch branch to go red. |
…ngular#42937)" This reverts commit bb5facb.
|
#42971 rolls this back in patch branch only. |
|
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. |
Add a
makeTemplateDiagnosticwrapper in theTemplateTypeChecker. This requiers less parameters to create template diagnostics, since theTemplateTypeCheckercan get the templateId and mapping from it's scope with thets.ClassDeclartion. TheTemplateTypeCheckeris often used to determine if a diagnostic should be produced, so it makes sense to have a function in it that helps create them.Refs #42966
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently to create a template diagnostic you need to pass the templateId and it's mapping as parameters.
What is the new behavior?
The wrapper function takes the
ts.ClassDeclarationand gets the templateId and mapping from it to create the template diagnostic.Does this PR introduce a breaking change?
Other information