Skip to content

Improved handling of incomplete blocks#52047

Closed
crisbeto wants to merge 3 commits intoangular:mainfrom
crisbeto:incomplete-blocks
Closed

Improved handling of incomplete blocks#52047
crisbeto wants to merge 3 commits intoangular:mainfrom
crisbeto:incomplete-blocks

Conversation

@crisbeto
Copy link
Copy Markdown
Member

@crisbeto crisbeto commented Oct 5, 2023

Includes a few changes that make it easier to recover from incorrectly-written or unknown blocks, instead of throwing an error immediately. The changes are meant to make it easier to integrate blocks into the language service and to log better errors. Includes the following commits:

refactor(compiler): handle incomplete blocks in the lexer

Updates the lexer to parse blocks as incomplete, instead of throwing errors. This will allow us to better handle them further down in the pipeline.

refactor(compiler): recover from incomplete blocks

Adds some logic to treat incomplete blocks as empty blocks so that we can recover from them. Also logs an error about the incomplete block.

refactor(compiler): introduce unknown block node

Adds an UnknownBlock node to the Ivy AST to represent blocks that haven't been recognized by the compiler. This will make it easier to integrate blocks into the language service.

Updates the lexer to parse blocks as incomplete, instead of throwing errors. This will allow us to better handle them further down in the pipeline.
Adds some logic to treat incomplete blocks as empty blocks so that we can recover from them. Also logs an error about the incomplete block.
Adds an `UnknownBlock` node to the Ivy AST to represent blocks that haven't been recognized by the compiler. This will make it easier to integrate blocks into the language service.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release area: compiler Issues related to `ngc`, Angular's template compiler labels Oct 5, 2023
@ngbot ngbot bot modified the milestone: Backlog Oct 5, 2023
@crisbeto crisbeto modified the milestones: Backlog, v17-candidates Oct 5, 2023
@crisbeto crisbeto requested review from atscott and dylhunn October 5, 2023 12:47
@crisbeto crisbeto marked this pull request as ready for review October 5, 2023 12:47
Copy link
Copy Markdown
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for implementing!

Copy link
Copy Markdown
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

👌

@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 Oct 5, 2023
@ngbot
Copy link
Copy Markdown

ngbot bot commented Oct 5, 2023

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing
    pending status "mergeability" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@atscott
Copy link
Copy Markdown
Contributor

atscott commented Oct 5, 2023

This PR was merged into the repository by commit 40c5357.

@atscott atscott closed this in a687ef9 Oct 5, 2023
atscott pushed a commit that referenced this pull request Oct 5, 2023
Adds some logic to treat incomplete blocks as empty blocks so that we can recover from them. Also logs an error about the incomplete block.

PR Close #52047
atscott pushed a commit that referenced this pull request Oct 5, 2023
Adds an `UnknownBlock` node to the Ivy AST to represent blocks that haven't been recognized by the compiler. This will make it easier to integrate blocks into the language service.

PR Close #52047
@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 Nov 6, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
)

Updates the lexer to parse blocks as incomplete, instead of throwing errors. This will allow us to better handle them further down in the pipeline.

PR Close angular#52047
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
Adds some logic to treat incomplete blocks as empty blocks so that we can recover from them. Also logs an error about the incomplete block.

PR Close angular#52047
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
Adds an `UnknownBlock` node to the Ivy AST to represent blocks that haven't been recognized by the compiler. This will make it easier to integrate blocks into the language service.

PR Close angular#52047
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: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants