Skip to content

Extracting Method doesn't work #10

@DarkRedman

Description

@DarkRedman

I use the function Extract Method, I put the name of my function and press enter and I get that :

Traceback (most recent call last):
  File "/home/<username>/stats/gestion/tmpmmq31e", line 12, in <module>
    changes = ExtractMethod(myproject, ropy, 34, 37).get_changes('sum', similar=True)
  File "/usr/lib/python3.10/site-packages/rope/refactor/extract.py", line 83, in get_changes
    new_contents = _ExtractPerformer(info).extract()
  File "/usr/lib/python3.10/site-packages/rope/refactor/extract.py", line 285, in __init__
    _ExceptionalConditionChecker()(self.info)
  File "/usr/lib/python3.10/site-packages/rope/refactor/extract.py", line 439, in __call__
    self.base_conditions(info)
  File "/usr/lib/python3.10/site-packages/rope/refactor/extract.py", line 451, in base_conditions
    raise RefactoringError("Bad region selected for extract method")
rope.base.exceptions.RefactoringError: Bad region selected for extract method

[Refactoring was finished in 0.4s with exit code 1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions