Ensime + Emacs not using latest classes of a dependency

54 views Asked by At

Package A depends on package B (0.1.0). I can modify package B, re-publish it (0.1.1), and then switch back over to package A, I run SBT clean, restart SBT, then run compile, and it grabs the latest version and understands that the classes have changed.

Ensime, however, does nothing. It seems to have some memory of the old class. Removing the .ensime_cache does not help. Recreating the .ensime file seems to show it resolving the latest version of the package that I want, but does nothing. Closing and re-opening the files does not help. Running M-x ensime does not do anything. Inspecting the class shows the old version, which is apparently living somewhere, but I don't know where.

Please help me understand what ensime is doing.

1

There are 1 answers

0
Nandan Rao On

OK - The problem was my understanding of how emacs via ensime is communicating with SBT. I was running my own SBT in a shell, which ensime, naturally, knew nothing about.

If, however, I run ensime-sbt, then the clean/re-run, then ensime picks up the changes and all editing can progress peacefully. So it appears that it runs its own internal sbt, even when you're not running ensime-sbt explicitly. Or if it's not doing that, the effect is at least the same...