Cursive 1.12.8

189 views
Skip to first unread message

Cursive

unread,
Mar 28, 2023, 2:00:59 AM3/28/23
to cur...@googlegroups.com

Hi everyone,

Cursive 1.12.8 is out! This release adds support for IntelliJ 2023.1, and has a lot of new REPL usability features.

The main new changes are to the REPL commands (doc for the previous version is here). The REPL commands are now configured in the Preferences, under Preferences | Languages & Frameworks | Clojure | REPL Commands, and the UI for adding and editing them has had a long-overdue makeover. The previous Add and Edit actions have been removed.

There's now a clear separation between global commands and those which are specific to a particular project, and the standard options for organising commands now work as expected. There are new options to clear the REPL output before running a command, and there is now an option to execute the command in the current editor namespace. You can now also choose to execute either the top-level form around the caret, the form before the caret, or the innermost list surrounding the caret, in addition to the previous options.

You can now configure commands to cause either the current file or all files to be reloaded from disk after the command is run. This is useful for refactoring or formatting commands where IntelliJ needs to pick the changes up after the command is finished.

You can also now configure the commands to control how the result of the evaluation is used. It can be printed to the REPL output as with normal evaluations, the original form can be replaced with the result (useful for refactorings or macro expansion), you can copy the result to the clipboard, and you can insert the result into the current editor. Since these actions are mostly orthogonal, you can choose several of them for a particular command. For example, you can echo the result to the output but also copy it to the clipboard.

Finally, you can also control whether the commands themselves are echoed to the REPL pane, and whether they're added to the REPL history. This will help in making commands feel more like their built-in equivalents, and allow them to be configured to be less intrusive to your workflow.

These changes should finally allow you to make commands which mimic the built-in REPL actions and customise their behaviour, as well as creating all sorts of useful actions.

This release also fixes some other annoying REPL usability issues around the REPL history search function. Historically, the popup for the history search has had all sorts of rendering problems when there were large items in the history. Cursive now limits the displayed size of the items in the selection list, as well as displaying the namespace in which the form was executed. Filtering on typing still filters using the full text, also visible in the preview panel below. It's also now possible to delete items from the history from this popup, which also helps work around weird problems, for example issues saving settings when there are non-XML-safe characters in the REPL history.

There is one more change which might trip current users up. Previously, selecting a history item would cause it to be copied to the REPL editor, and you had to use shift to execute the form immediately. Since I added this feature, it has become clear that the workflow preferred by most people is executing forms directly from an editor rather than typing into the REPL editor. In that spirit, the default action is now to execute immediately, and you have to use shift if you want to copy the form to the editor. I apologise for the (hopefully brief) annoyance this might cause users with muscle memory already built up.

There is also a new action in the REPL menu, "Execute Bookmarked Form". If you have particular lines bookmarked, you can now quickly execute them in the REPL using a popup similar to the REPL history one. This is a little experimental, and I'm interested in feedback on how useful it is and how it might be improved. In particular, there's currently no support for executing a particular form quickly using the mnemonic shortcut for a particular bookmark - that's something I plan to add. As with the history popup, the forms are shown with the namespace in which they appear, and when executed they'll be executed in that namespace, as if they were sent from the editor.

There are also numerous bug fixes, fixing a bug with REPL startup for users using Shadow CLJS, another with the new :as-alias feature in CLJS, an indentation bug when auto-requiring namespaces, as well as numerous bugs reported via the issue tracker.

Here are the issues:

Added

  • Add support for IntelliJ 2023.1 EAP #2764
  • Support Evaluating Bookmarked Forms #2623
  • "Reload all from disk" after REPL command #2597
  • Execute REPL command in current file namespace #1756
  • Support inline output replace on REPL commands #1755
  • "Clear REPL" before executing a REPL command #1459
  • Add ability to delete items from REPL history #1383

Changed

  • Improve ordering of entries in Edit REPL Commands window #2622
  • REPL commands get added to REPL history #1990
  • Edit REPL Commands window should have + button to create a REPL command #1415
  • Missing command? #843

Fixed

  • :as-alias doesn't correctly prevent cyclic dependency warnings in CLJS #2782
  • Incorrect indentation when adding new require clauses to ns form #2763
  • REPL does not automatically select .shadow-cljs/nrepl.port for nREPL connection type #2759
  • Sometimes unable to view diff on test failure #2723
  • REPL History window opens on secondary monitor #2294
  • REPL history hangs Intellij #1325
  • REPL Search History Renders Incorrectly #971

Cheers,
Colin

Reply all
Reply to author
Forward
0 new messages