Skip to content
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

Special handling of previous/next scope when in a code block/body #2627

Open
AndreasArvidsson opened this issue Aug 4, 2024 · 0 comments
Open

Comments

@AndreasArvidsson
Copy link
Member

AndreasArvidsson commented Aug 4, 2024

Today's behavior given is a bit awkward around nested scopes. eg

if |value == 0:
   return None
print("after")

In this scenarios saying "take next state" I would expect to select the print statement, but you actually get the return statement. This is because we yield the statements in document order and we don't skip descendant scopes.

The reason why we can't just skip the containing scope altogether is this example

if|value == 0:
   |
   return None
print("after")

Here the if statement is containing so the statement after containing would be print, but in this scenario I definitely would expect the return statement for "take next state".

One solution to this is to have specific behavior when inside of a code block/body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant