Skip to content

fix(compiler): recover template literals with broken expressions#64150

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:63940/template-literal-recovery
Closed

fix(compiler): recover template literals with broken expressions#64150
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:63940/template-literal-recovery

Conversation

@crisbeto
Copy link
Copy Markdown
Member

Fixes two issues that were preventing template literals from being recovered properly if one of the interpolated expressions is broken:

  1. We weren't updating the expected brace counter when an interpolation starts which in turn was throwing off the recovery logic in skip.
  2. When producing tokens for template literals, we were treating the closing brace as an operator whereas other places treat it as a character. Even after fixing the first issue, this was preventing the recovery logic from working correctly.

Fixes #63940.

Fixes two issues that were preventing template literals from being recovered properly if one of the interpolated expressions is broken:
1. We weren't updating the expected brace counter when an interpolation starts which in turn was throwing off the recovery logic in `skip`.
2. When producing tokens for template literals, we were treating the closing brace as an operator whereas other places treat it as a character. Even after fixing the first issue, this was preventing the recovery logic from working correctly.

Fixes angular#63940.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 30, 2025
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Sep 30, 2025
@ngbot ngbot bot added this to the Backlog milestone Sep 30, 2025
@crisbeto crisbeto marked this pull request as ready for review September 30, 2025 08:49
@crisbeto crisbeto requested a review from atscott September 30, 2025 08:51
@atscott atscott added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 30, 2025
@crisbeto
Copy link
Copy Markdown
Member Author

Passing TGP

@kirjs
Copy link
Copy Markdown
Contributor

kirjs commented Sep 30, 2025

This PR was merged into the repository. The changes were merged into the following branches:

kirjs pushed a commit that referenced this pull request Sep 30, 2025
)

Fixes two issues that were preventing template literals from being recovered properly if one of the interpolated expressions is broken:
1. We weren't updating the expected brace counter when an interpolation starts which in turn was throwing off the recovery logic in `skip`.
2. When producing tokens for template literals, we were treating the closing brace as an operator whereas other places treat it as a character. Even after fixing the first issue, this was preventing the recovery logic from working correctly.

Fixes #63940.

PR Close #64150
@kirjs kirjs closed this in 159be56 Sep 30, 2025
napulitanfrontend pushed a commit to napulitanfrontend/angular that referenced this pull request Oct 10, 2025
…ular#64150)

Fixes two issues that were preventing template literals from being recovered properly if one of the interpolated expressions is broken:
1. We weren't updating the expected brace counter when an interpolation starts which in turn was throwing off the recovery logic in `skip`.
2. When producing tokens for template literals, we were treating the closing brace as an operator whereas other places treat it as a character. Even after fixing the first issue, this was preventing the recovery logic from working correctly.

Fixes angular#63940.

PR Close angular#64150
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using template literals in html breaks auto complete

3 participants