其实解决方案特别简单。

fild->Invalidate Caches / Restart

  1. Open IntelliJ IDEA
  2. Select the File menu
  3. Select the Invalidate Caches / Restart… menu. Once selected you get a pop-up with a bunch of options.
  4. Select Invalidate and Restart and before doing that make sure you saved all your changes else it might delete some unsaved changes.

来源:https://stackoverflow.com/questions/15991561/intelli-j-idea-takes-forever-to-update-indices