Cursive 2025.1

Apr 16, 2025

Cursive 2025.1 is out! The first externally visible change in this release is that I'm switching to date-based versions, since Cursive is generally on a rolling update schedule and major version numbers don't really make a lot of sense. As before, the Cursive version (e.g. 2025.1-eap3) will come first, and then a shortened version of the IntelliJ version the build is for, e.g. 251 is for IntelliJ 2025.1 and 243 is for IntelliJ 2024.3.

The main new feature in this release is the ability to show HTML and SVG inline in the editor, which I think will unlock a lot of interesting use cases. Here's an example of inline SVG, credit to Timothy Pratley for the nice example:

This is triggered using tagged literals, like the previous inline renderers. If you evaluate a form like this:

(defn svg [offset]
  (let [circles (for [i (range 10 100 10)]
                  (let [hue (mod (+ offset (* (/ i 100) 360)) 360)  ; Map radius to hue (0-360)
                        color (str "hsl(" hue ", 100%, 50%)")]
                    (str "<circle r='" i "' stroke='" color "'/>")))]
    (str "<svg height='200' width='200'>"
         "<g transform='translate(100,100)' fill='none'>"
         (str/join circles)
         "</g>"
         "</svg>")))

(comment
  ; Evaluate this to see the SVG inline
  (tagged-literal 'cursive/html {:html  (svg 0)
                                 :title "SVG Circles"
                                 :key   "example"}))

You'll get Timothy's circles example from the screenshot above. Note that this doesn't require hiccup or anything else if you don't want it, but you can use it if you want to. For example, I use this now when designing the icons for Cursive, which are SVGs I create programmatically:

It's worth emphasising that this is a full Chromium browser, so it will run JavaScript and do whatever else you'd expect your browser to do. I think there's a lot of scope for interesting features around communication between the browser and the REPL process, but that's not there yet.

By default, the HTML/SVG is displayed inline, but if you'd rather open it in a new editor, you can add a :display :editor key, and it will be opened in a new editor instead. This can be useful if you want to open a large file, for example if you're using Clay, Clerk or something similar, or working on a website. If you're opening the file in a new editor you can also supply a :title "Some title" key which will be used as the title of the editor.

When you're working iteratively on some content like this, you often want to update the content in an existing editor or inlay. For this you can supply a :key "some-key" key, and if there is an existing display of content with the same key it will be updated rather than opening a new copy.

I'll have full documentation and a demo video for this up soon.

Calva also released a similar feature recently, and to aid targeting both editors, Cursive will also accept Calva's #flare/html{} syntax in addition to #cursive/html{}.

This release adds support for the new IntelliJ 2025.1 build. I've also fixed many bugs, and added support for automatically excluding some well-known directories for Clojure projects which shouldn't be considered part of the project. The list is customisable in the settings in the usual place under Settings | Languages & Frameworks | Clojure. There are lots of fixes to the REPL selector, including the ability to disable it completely and revert entirely to the previous behaviour. There are also some fixes to the testing functionality and the new interop syntax, and the ability to use Fill Paragraph to reformat contiguous line comments.

Here are the issues:

Added

  • Add support for 2025.1 EAP #3009
  • Mark known clojure directories as excluded by default #2969
  • Reformatting doesn't reflow doc strings #653

Changed

  • Repl scope configuration is very confusing. #3008
  • Add an option "Use open REPL pane" to restore previous behaviour #2988
  • REPL commands intended for CLJ REPLs don't work in CLJS or EDN files #2985

Fixed

  • Cannot load namespace into a build.clj REPL #3023
  • Problems resolving source path from library overridden in user deps.edn #3022
  • Error printing Java object #3021
  • Problems printing unreadable exceptions #3020
  • Adding new modules to a project with name conflicts fails #3012
  • Cursive doesn't correctly resolve data readers from libraries #3011
  • "Show virtual space at the bottom of the file" setting causes inline diffs to expand infinitely #3010
  • Re-run last test action does not in HTML files #3007
  • print-dup breaks REPL test integration #3006
  • New Method Reference syntax for instance methods is flakey #2997
  • "Internal error: cannot patch the selected configuration" when running debugger #2995
  • test exceptions not shown sometimes, "Error handling response" in repl #2994
  • cursive.repl.runtime.errors/ex->data throws #2993
  • Thread/interrupted receives incorrect warning #2989
  • Config items in new REPL settings pane are not searchable #2987
  • Cannot "Clear Output for Current REPL" anymore if its not running #2984
  • Test runner reports failing tests as passed if actual or expected contains ansi color codes #2973
  • IllegalArgumentException with :shrunk field in custom IPersistentMap implementation #2966

Cursive 2025.1-eap3