Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing project.clj sometimes requires a full restart of IntelliJ #58

Closed
levand opened this issue Oct 23, 2013 · 4 comments
Closed

Changing project.clj sometimes requires a full restart of IntelliJ #58

levand opened this issue Oct 23, 2013 · 4 comments
Milestone

Comments

@levand
Copy link

levand commented Oct 23, 2013

I have observed this switching between Datomic Pro & Datomic Free in project.clj.

Launching a new REPL with "start local nREPL console" doesn't appear to pick up the changes as observed by printing out the classpath from the REPL with (System/getProperty "java.class.path").

It picks up the changes after completely restarting IntelliJ.

I presume it happens with other dependencies, too. Perhaps something is being cached?

@cursive-ide
Copy link
Owner

Just ruling out the obvious - the Lein integration doesn't currently automatically update dependencies when project.clj is changed, unlike IntelliJ's Maven integration. Are you hitting refresh in the Leiningen toolwindow after changing dependencies? When you do that you should see the libraries update in the External Libraries section of the Project Toolwindow. That would have been an excellent thing to mention in the release notes.

BTW I'm not sure if you saw, but there's a workaround for the datomic symbols not resolving in #38.

@levand
Copy link
Author

levand commented Oct 24, 2013

Ah, that may be user error then. My strong presumption would be that shutting down and restarting the repl would re-read the project.clj file since that how it works in every other Clojure dev system, but manually refreshing would probably work too.

Might be worth a doc callout if that's hard to change for some reason.

@cursive-ide
Copy link
Owner

Yeah, I'm planning to add auto-import on project.clj changes, but I wanted to get the lein integration stable with no magic first. The issue with reading project.clj at random points is startup time - currently I read project.clj in-process but that causes some problems (I can't change the CWD and some libs do crazy things, e.g. Storm) plus it loads a bunch of namespaces into the IntelliJ instance, so I should really spin up a new JVM to do all that but it takes a couple of seconds each time.

For your specific problem I'm planning to add an option to start the REPL using lein which should make the REPL always work reliably, at least.

@cursive-ide
Copy link
Owner

This is fixed in the new build. There are now options under Settings->Clojure for synchronising Leiningen before a local REPL start, and for compiling the project before local REPL start, both on by default. The sync option should solve your problem above. It's not very clever right now, it basically does a full project sync, so I'd be very interested to know if performance is a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants