> You’re working with dynamic languages; it’s a hard problem.
It's not that hard a problem. At least TypeScript is statically typed and in Python we're using type annotations everywhere. Besides, the bugs I was talking about mostly concern imports (I move file.py from A/ to B/ and PyCharm forgets to update `import A.file` to `import B.file`), and renamings (PyCharm suddenly renames some random variable deep inside dependencies like Tensorflow, too, so I end up having to re-setup my entire Python environment afterwards).
The thing is: Those auto-suggestions for imports work totally fine and code navigation via Ctrl+click works fine, too. So PyCharm does interpret the import statements correctly and I'm at a loss as to why the refactoring doesn't work then, too. Maybe auto-completion and refactoring are two completely separate systems?
I’m not gonna deny it’s frustrating to see quality of life stuff like “don’t refactor stuff from packages!” unaddressed year after year.
...but I think it is a tricky problem.
For example Black[1] is a very carefully crafted project that does an excellent job, but it fails at refactoring files just to apply lints with “inconsistent code generated” on some projects and files; and that’s just apply limiting rules.
...but, I for whatever reason, the JetBrains refactoring for static languages (c#, Java, kotlin) does seem significantly superior.
It's not that hard a problem. At least TypeScript is statically typed and in Python we're using type annotations everywhere. Besides, the bugs I was talking about mostly concern imports (I move file.py from A/ to B/ and PyCharm forgets to update `import A.file` to `import B.file`), and renamings (PyCharm suddenly renames some random variable deep inside dependencies like Tensorflow, too, so I end up having to re-setup my entire Python environment afterwards).
The thing is: Those auto-suggestions for imports work totally fine and code navigation via Ctrl+click works fine, too. So PyCharm does interpret the import statements correctly and I'm at a loss as to why the refactoring doesn't work then, too. Maybe auto-completion and refactoring are two completely separate systems?