Cursive 1.8.0-eap2

478 views
Skip to first unread message

Cursive

unread,
Jul 18, 2018, 11:16:53 PM7/18/18
to cur...@googlegroups.com

Hi everyone,

Cursive 1.8.0-eap2 is out. The main new feature is support for managing project dependencies with Clojure’s new deps.edn. It’s still pretty experimental so feedback is very welcome. It’s using a new-ish API for build system integration in IntelliJ which I’m not familiar with and which has some funky corners, so a total re-write of the IntelliJ integration part is still a possibility. In that case, deps projects would have to be re-imported, it won’t be possible to provide a migration. Deps itself is also a little unconventional and has some features which go against some things which are fairly ingrained into IntelliJ, so the integration may have to change significantly if they turn out to be a problem.

Here’s a list of potential gotchas or problems:

When creating inter-project dependencies using :local/root, Cursive will create a library rather than a module dependency. This is because deps is unusual in how things like source paths are propagated from dependent projects to the root ones. Since a build integration would normally create a module dependency I’ve had to fix some bugs relating to that, but there may be more.

Deps also has no concept of the name of a project in the deps file, so there’s nothing for Cursive to be able to derive a module name from. Currently it just uses the name of the containing directory, but since module names must be unique this will be a problem if you have something like server/api and client/api. Suggestions for how to work around this are welcome.

Similarly, the only reasonable thing to call the library used for a :local/root dep is the name of the symbol used to declare it in the deps.edn file. But if two separate projects reference the same dependency using different names then two separate libraries will be created pointing to the same sources. I’m not sure if this will create issues or not, at best it’s ugly.

The IntelliJ API has a concept of “linked projects”, which are projects managed via build files which you’ve registered with the IDE. The lein integration works like the Maven integration does, i.e. you need to register all the project.clj files which are part of your project. This new API only supports systems more like the Gradle integration which is based on the same API I’m using. Here, you only register the root project with the IDE, and the subprojects (:local/root dependencies in deps) are discovered and added automatically. This is bound to cause confusion for those coming from using lein.

Important tl;dr of the above paragraph: when using deps, only import your root projects, not libraries which other projects reference via :local/root.

This integration requires you to have the CLI tools installed, and it uses them for some of its functionality. Unfortunately this means that it can’t be used on Windows yet, although I have a plan to fix that.

Cursive will try to create tasks for the various aliases that are registered with runtime options in deps files. However the interface for working with them is weird and I haven’t investigated it yet. So things like running depstar and the like will probably not work via the IDE yet.

REPL support is currently limited to what was available previously - that’s next on my list to upgrade.

The integration should work similarly to the other integrations in IntelliJ, so hopefully it will all feel familiar. If not, let me know and I can explain.

In addition to deps support, there’s now an option to use double semicolons for line comments, for Emacs compatibility. It can be turned on using Editor->General->Smart Keys->Clojure->Use ;; for line comments.

Here are the issues:

Request: config to use two semicolons ;; for line comments #1983
Support for deps.edn #1910
ToolWindow icons should be 13x13 #456

Cheers,
Colin

Yehonathan Sharvit

unread,
Jul 23, 2018, 12:52:51 AM7/23/18
to Cursive
Great news.
When do you expect it to be available for Windows?

Colin Fleming

unread,
Jul 23, 2018, 7:08:01 AM7/23/18
to cur...@googlegroups.com
I'm hopeful that will be in the next EAP, probably later this week, assuming it doesn't turn out to be much harder than I expect.

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.
To post to this group, send email to cur...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yehonathan Sharvit

unread,
Jul 24, 2018, 1:30:47 PM7/24/18
to cur...@googlegroups.com
I hope so

You received this message because you are subscribed to a topic in the Google Groups "Cursive" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cursive/32tfBegzfVc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cursive+u...@googlegroups.com.

To post to this group, send email to cur...@googlegroups.com.

Colin Fleming

unread,
Jul 27, 2018, 2:19:43 AM7/27/18
to cur...@googlegroups.com
Unfortunately I didn't quite get this done this week, but it's looking good and should be out on Monday.

Yehonathan Sharvit

unread,
Jul 27, 2018, 2:47:36 AM7/27/18
to cur...@googlegroups.com
Good luck for completing it.

Reply all
Reply to author
Forward
0 new messages