Refactor/rename across different files

Answered

Hi,

When I refactor/rename a variable that occurs across different files in my Python project, it finds its occurrences in comments in other files, but it misses the "real" occurrences in other files. I suspect that this may be because for two totally unrelated files, PyCharm has no way to know that the occurrences in each file are meant to refer to the same variable. However, I am importing one file from the other as a module, so I assume PyCharm should know that both names will refer to the same variable. And the fact that it finds the ocurrences in other files' comments prove PyCharm is indeed scanning all the files in the project...

 

Am I doing something wrong, or this a true lack of a feature?

1 comment

Hi Jacobo,

It is indeed depends on how you use this variable in the code. Would it be possible to provide some example?
When I do refactor-->rename it works as expected and renames the variable in all files where it is used.

0

Please sign in to leave a comment.