Skip to content

Add a method for conditional deferral and use it in the new analyzer #6725

Closed
@ilevkivskyi

Description

@ilevkivskyi

This idea appeared in #6724. It will be useful for plugins and in general to have something like this in SemanticAnalyzer:

def defer_if_possible(self) -> bool:
    if not self.final_iteration:
        self.defer()
        return True
    return False

Then it can be used like this:

if ctx.api.defer_if_possible():
    ...
else:
    ... # probably give some error

Maybe we can also add it to the old analyzer as always returning False, then we can completely hide the old vs new analyzer details in plugin API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions