What's the difference between Remove and Exclude when refactoring with PyCharm?

Viewed 1341

The official PyCharm docs explain Exclude when it comes to refactoring: One can, say, rename something with refactoring (Shift+F6), causing the Find window to pop up with a Preview. Within, it shows files which will be updated as a result of the refactor. One can right-click on a file or folder in this Preview and choose Remove or Exclude. What's the difference?

1 Answers

Final effect is the same - entry which was Removed or Excluded won't be refactored, the difference is in presentation. After selecting Exclude you keep entry in the Refactoring Preview, but Remove deletes it from that window.

I think that Remove could be useful when you deal with quite large refactoring and marking everything as excluded could lead to unreadable mess.

Keep in mind, that remove action can't be undone - you have to start new refactoring...

Related