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:
- 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.
- 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.
- 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.
- 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