Describe the bug
The match statement allows pattern capture which effectively acts like an assignment statement. Currently they are not recognised as assignment statement that can define a variable.
To Reproduce
Steps to reproduce the behavior:
- Code before refactoring:
x = [1, 2, 3]
match x:
case [1, *_] as old_name_1:
print(old_name_1)
case [2, *old_name_2]:
print(old_name_2)
-
Describe the refactoring you want to do: rename old_name_xxx to new_name_xxx
-
Expected code after refactoring:
x = [1, 2, 3]
match x:
case [1, *_] as new_name_1:
print(new_name_1)
case [2, *new_name_2]:
print(new_name_2)
- Describe the error or unexpected result that you are getting
RefactoringError: Rename refactoring should be performed on resolvable python identifiers
Describe the bug
The match statement allows pattern capture which effectively acts like an assignment statement. Currently they are not recognised as assignment statement that can define a variable.
To Reproduce
Steps to reproduce the behavior:
Describe the refactoring you want to do: rename
old_name_xxxtonew_name_xxxExpected code after refactoring: