sbt-idea icon indicating copy to clipboard operation
sbt-idea copied to clipboard

gen-idea can't always fix imports when changing libraries

Open ShardPhoenix opened this issue 10 years ago • 2 comments

I'm using sbt-idea 1.6.0. When adding new libaries or changing library versions, sometimes I'll naturally get "cannot find import" errors in IDEA even when it works on the command line. Usually, running gen-idea in sbt will fix this. However, sometimes this won't work no matter how many times I run gen-idea (or restart IDEA) - I'll keep getting the not-found errors in IDEA. I can only fix it by deleting the project's .iml file and running gen-idea again. May be related to switching between different versions of the same library, but I'm not 100% on that.

ShardPhoenix avatar Apr 28 '14 03:04 ShardPhoenix

I may have encountered the same bug. Whenever I change libraries, after gen-idea idea project becomes corrupted (some libraries are not visible / duplicated and imports are not resolved).

I found a workaround that does not require you to remove imls. Try this:

  • Close project
  • run sbt gen-idea and wait until it finishes
  • Open project

Works every time. Of course it is still very irritating... My only guess so far is that idea and gen-idea write to imls at the same time, which results in corrupted files.

SheliakLyr avatar May 05 '14 18:05 SheliakLyr

could it be this http://youtrack.jetbrains.com/issue/IDEA-121781 ?

OlegYch avatar May 26 '14 12:05 OlegYch