I had a similar problem with 2019.1.4. However, mine would change directories and sometimes, eventually, finish. If it did finish, it was somewhere in the 8-10 minute range.
I was all over SO, and even JetBrains' forums. I excluded directories via Project Structure | Modules
. I used Invalidate Caches And Restart
on multiple occasions. I tried having only 1 project open to let it finish. I installed and tried 2019.2.4 and 2019.3.3 (the latter would crash for other reasons). And best of all, it only seemed to happen on one project!
What ultimately led me to an answer was Help > Activity Monitor...
where I found psi.impl.cache.impl.todo
was running at nearly 100% CPU and not showing signs of stopping.
It turned out, I had a TODO filter setup with a poorly-defined RegEx. It was something like \b.*wip\b.*
; the idea was to find all of our "WIP" values. Well, the leading .*
was a huge mistake and one that didn't occur to me until losing many hours blaming a plugin upgrade. I believe the reason this was a bad filter was because the project it was hanging on is in ExtJS, which is JavaScript, which means things are in triplicate with the app.js
file and whatnot...