This refactoring aims to flip the value of a Boolean variable and all its usages from True to False and vice versa.
Example
Before | After |
---|---|
def foo{}: abc<caret here> = True return abc |
def foo{}: abc = False return not abc |
- Place the caret at the name of a Boolean variable.
- Do one of the following:
- On the main menu, choose .
- On the context menu at caret location, choose .
- In the dialog box that opens, click Preview to view the suggested changes in the Find tool window, or Refactor to invert the detected occurrences silently.