Extract of incomplete block is allowed to half-execute
raymyers opened this issue · 0 comments
raymyers commented
Describe the bug
Currently Rope will allow an extract to partially execute that includes the statement that begins an indented block but not the last statement in the block.
To Reproduce
Steps to reproduce the behavior:
- Code before refactoring:
if True:
a = 1
b = 2
- Describe the refactoring you want to do
Extract function of the region marked in comments
# start {{
if True:
a = 1 # }} end
b = 2
- Expected code after refactoring:
No change, exception raised
- Describe the error or unexpected result that you are getting
No exception raised, creates a new function but does not replace the target region with a call to it.
Editor information (please complete the following information):
- Rope Python version: 3.10
- Rope version: Rope 1.10