Brave users wanted to test new Deps support

342 views
Skip to first unread message

Colin Fleming

unread,
Sep 1, 2019, 11:07:39 PM9/1/19
to Cursive Group
Hi everyone,

As many of you will know, the 2019.x versions of IntelliJ have not been kind to Cursive in terms of serious platform bugs affecting it. I have a summary email of these problems here, in case you haven't seen it.

Many of these problems have been in the Deps support. When I first started developing Deps I made a decision to base the support on a relatively new IntelliJ API for build system support, instead of basing it on the Leiningen integration. Unfortunately that decision didn't work out well for me. All these Deps bugs have been in this API, and it's also inflexible in very annoying ways (cursive-2214, as just one example, is basically impossible to fix). Additionally, since I support the last two years' worth of IntelliJ versions and this API has been under heavy development over that time, pretty much every change I make gives me a merge conflict on every branch during development.

Because of all this I decided to migrate the Deps support to use the existing lein infrastructure as a base. That work is now available to test as a dev build, so if you're able to try it out I'd love feedback on how it works. To install it, go to the Cursive plugin repo versions page, select "Dev" and then download the revision of 1.9.0-SNAPSHOT1 corresponding to the IntelliJ version you're using. You can then install the plugin by going to Settings->Plugins, selecting the gear icon, choosing "Install Plugin from Disk..." and then pointing it at the zip file you just downloaded.

As you might expect, there is also a list of caveats to bear in mind:

  1. When you open an existing Deps project, your project files will be migrated to the new format. IntelliJ will keep a copy of your existing files in case you want to downgrade again.
  2. Currently when syncing a project, your entire IntelliJ project will be synced in one go - the previous integration did this module by module, which can be slow for really massive projects with a lot of sub-modules. I'm planning to fix this.
  3. Currently Cursive will prompt you if one of your config files has been updated, but there's no auto-import yet. I'm also planning to fix this soon.
  4. There's currently no Deps run configuration type to automatically run -M alias types. You can run them using the standard Clojure Application run config for the moment. If you choose "Run with Deps" in the run configuration and add the alias there then any extra deps will be added to the classpath correctly, but you'll have to specify the main namespace and any other programs args manually for now.

One nice feature of the new integration (apart from the fact that it actually works) is that multi-module support is improved, so you can now specify the base directory of a multi-module project when importing and it will recursively search for deps.edn files to add.

Cheers,
Colin

Colin Fleming

unread,
Sep 2, 2019, 5:39:03 AM9/2/19
to Cursive Group
Sorry, re-reading this, my caveat #2 is unclear. What can be slow is refreshing the whole project at once (which the integration does currently), not refreshing module by module. This is required by the lein integration but not by the Deps one, so I should be able to fix this soon.

Cheers,
Colin
--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.

dan young

unread,
Sep 2, 2019, 6:52:18 PM9/2/19
to cur...@googlegroups.com
Hello Colin,

Thank you for your email.  \

Trying this out with one of my ClojureScript projects....and I think I have this setup correctly and can launch a REPL. When I try to do a require in the repl, it seems like the npm modules are not getting picked up/loaded.   Maybe I have something wrong in my configuration? When I run it on the command line it works fine...
I've attached a screenshot of my cursive REPL config.

After starting the REPL, I usually do the following:

shift+command+p =>(comment (require '[lever.core :as lever] :reload))
shift+command+p =>(comment (in-ns 'lever.core))

I now get this error while trying to reload/load the core ns

Execution error (Error) at (<cljs repl>:1).
Cannot find module 'request'


Command line:
 (master) clj -m cljs.main --output-dir out -re node -co repl.edn -r
REPL env options: {:output-dir "out"}
ClojureScript 1.10.520
cljs.user=> Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/core.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/clojure/walk.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/spec/gen/alpha.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/clojure/string.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/spec/alpha.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/repl.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/pprint.cljs

cljs.user=> (require '[lever.core :as lever] :reload)
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async/impl/protocols.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async/impl/buffers.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async/impl/dispatch.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async/impl/channels.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async/impl/timers.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async/impl/ioc_helpers.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/core.async/0.4.474/core.async-0.4.474.jar!/cljs/core/async.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.cli/0.4.1/tools.cli-0.4.1.jar!/clojure/tools/cli.cljc
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader/impl/utils.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader/reader_types.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader/impl/inspect.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader/impl/errors.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader/impl/commons.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/tools.reader/1.3.0/tools.reader-1.3.0.jar!/cljs/tools/reader/edn.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/reader.cljs
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar!/camel_snake_kebab/internals/string_separator.cljc
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar!/camel_snake_kebab/internals/misc.cljc
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar!/camel_snake_kebab/internals/alter_name.cljc
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar!/camel_snake_kebab/core.cljc
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar!/camel_snake_kebab/extras.cljc
Reading analysis cache for jar:file:/Users/danyoung/.m2/repository/org/clojure/clojurescript/1.10.520/clojurescript-1.10.520.jar!/cljs/nodejs.cljs
Reading analysis cache for file:/Users/danyoung/Documents/GitHub/looker/data-engineering/node-projects/lever/core-api/src/lever/core.cljs
nil
cljs.user=> (in-ns 'lever.core)
nil
lever.core=> 

Screen Shot 2019-09-02 at 4.50.01 PM.png

dan young

unread,
Sep 2, 2019, 7:04:08 PM9/2/19
to cur...@googlegroups.com
NVM, I'm a knucklehead....forgot I nuked the node  modules directory. Needed to rerun the build since I have install deps set to false in my repl alias....doooh

On Sun, Sep 1, 2019 at 9:07 PM Colin Fleming <cur...@cursive-ide.com> wrote:

Colin Fleming

unread,
Sep 9, 2019, 1:27:40 AM9/9/19
to Cursive Group
There's a new dev build out which caches the resolve information per project, so it will now only refresh the required projects. For large projects this should be significantly faster. It also now shows better progress updates - it will show the project being read/resolved, and also show the Downloading: and Checking out: messages from Deps, which helps when syncing large projects.

This still requires a manual install as below, but if this version seems OK I'll get an EAP build out with these changes soon.

Cheers,
Colin

dan young

unread,
Sep 11, 2019, 7:12:04 PM9/11/19
to cur...@googlegroups.com
Heya Colin,

Looking good so far on the deps.

Regards,

Dano


Colin Fleming

unread,
Sep 11, 2019, 9:33:51 PM9/11/19
to Cursive Group

Colin Fleming

unread,
Sep 17, 2019, 12:03:58 AM9/17/19
to Cursive Group
There's a new dev build out now. Barring any more bugs found, this will be the last dev build and the next will be an EAP.

Lots of bugs fixed and improvements:

  1. Cursive will now tidy up unused modules, which is particularly useful when switching between branches that have different modules.
  2. Several bugs fixed in the project conversion.
  3. :extra-paths from the test alias are once again synced as test folders, not source folders.
  4. When using the force refresh button in the toolwindow, the cached resolve info is discarded.
  5. Numerous other smaller fixes.

Cheers,
Colin

radu

unread,
Sep 17, 2019, 9:27:49 PM9/17/19
to Cursive
Hi Colin,
cursive-1.9.0-SNAPSHOT3-2019.2 fails to open a project created with 1.8.2-2019.2. For a very brief moment there's a window with only chrome and no content (the project window i assume) after which it quickly goes back to the Welcome to IntelliJ IDEA dialog. I don't see any Cursive explicit frame in the stack trace but it's probably related (see the attached log file),  because I could re-import the project after I deleted the .idea folder. I can't tell for sure now, but the project might have been in full screen when was close last time.

Cheers,
Radu
To unsubscribe from this group and stop receiving emails from it, send an email to cur...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cur...@googlegroups.com.
idea.log

Colin Fleming

unread,
Sep 17, 2019, 10:19:35 PM9/17/19
to Cursive Group
Hi Radu,

Thanks for the report. This is an IntelliJ bug in 2019.2, which is fixed in the 2019.2.3 EAP. You can get this EAP here: https://confluence.jetbrains.com/display/IDEADEV/IDEA+2019.2+EAP

Sorry, I should have mentioned that in the original email.

Cheers,
Colin
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.


Attachments:
  • idea.log

Imre Kószó

unread,
Sep 20, 2019, 4:13:41 AM9/20/19
to Cursive
Hey Colin, when do you think you'll have a dev build that's compatible with the 2019.2.3 EAP?

Colin Fleming

unread,
Sep 20, 2019, 6:20:31 AM9/20/19
to Cursive Group
Hey Imre, the current dev build is compatible with the 2019.2.3 EAP. If you mean the 2019.3 EAP, that will be coming shortly, I'm having to resolve some build system issues first. Hopefully early next week.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.

Imre Kószó

unread,
Sep 21, 2019, 3:55:26 PM9/21/19
to Cursive
Geez, so many EAPs, thanks. I got those confused alright.

Oleg Martynov

unread,
Sep 24, 2019, 3:29:04 PM9/24/19
to Cursive
Hi Colin,

Intellij IDEA 2019.2.3 (EAP), Cursive 1.9.0-SNAPSHOT3-2019.2

Cursive no longer reads the :paths key in the root of a project's deps.edn file (i.e. when it's not inside of an alias). Particularly, I have a "test" path in :paths and it is only included in the project when I move it into a separate alias (and enable it in "Clojure Deps" window).

Also, if there's no ~/.clojure/deps.edn file, then Cursive would crash with "Unable to run `clojure` command", even though clojure/clj CLI runs fine. ~/.clojure/deps.edn isn't created if you install clojure in Linux via curl, as recommended on the official website. I don't use Linux myself, but when I installed clojure/Cursive on other people's machines earlier, there was no such issue (but there's a chance I did it via package manager earlier).

Feel free to ask for more details and I also could create the issues on Github. Meanwhile, the update is awesome — thank you for your hard work!

Colin Fleming

unread,
Sep 26, 2019, 6:23:38 AM9/26/19
to Cursive Group
Hi Oleg,

Thanks for the report - that seems very strange, since that's very basic functionality. I'll try to reproduce this tomorrow.

Cheers,
Colin
--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages