Cursive 1.6.2

359 views
Skip to first unread message

Cursive

unread,
Nov 27, 2017, 8:51:50 PM11/27/17
to cur...@googlegroups.com

Hi everyone,

Cursive 1.6.2 is out now. As usual, this is a combination of the changes in the 1.6.2 EAP builds, there’s nothing new here for users on the EAP program. However I wanted to get a stable build out for those on the stable channel due to the imminent release of IntelliJ 2017.3.

The first new feature in this release is a change to how the stubs generation feature worked. This turned into a much larger change than I expected, and contains several fixes:

The error reporting in several failure cases is better, which should hopefully give some idea of why the generation is failing. I’m very interested in error messages from failing modules so I can make this feature more robust.
The stub generation prompt is now a notification, as discussed in #1599. This means that you can disable the notification group entirely in Settings->Appearance & Behavior->Notifications. Cursive will try to re-use the notification, so if you have already been notified and haven’t dismissed the notification, it shouldnt re-notify you.
As discussed in the Github issue, the issue with using the notification group is that you can only universally turn it off across all projects. I’ve added a config switch per module which will cause Cursive not to attempt to generate stubs for that module, it’s under Project Structure->Modules->[your module]->Clojure. There is also a link in each of the error notifications allowing stub generation to be disabled for the corresponding module - hopefully this will allow users to disable it for problematic modules but still leave it enabled for others.

Another feature that a lot of people have asked for recently is the ability to navigate to things which are “defined” using keywords, such as specs and re-frame elements. This is now supported, and navigation, find usages etc works as expected for specs and re-frame. Note that this only works for things defined using namespaced keywords (which is standard for spec, but not so much for re-frame) to avoid changing the semantics of bare keywords unexpectedly.

The structure view is now much more useful. It now shows these same things defined with keywords (specs, re-frame elements) as well as having much better support for classes (e.g. deftype/defrecord/definterface), multimethods, protocols and more, as well as delineating private vars with the standard IntelliJ lock icon.

Finally, one thing that has traditionally been a real chore for new users is setting up keybindings. It’s particularly difficult in Cursive because IntelliJ has so many bindings already which experienced IntelliJ users expect to continue to work as they expect, but Cursive also needs a lot for structural editing actions. In recent IntelliJ versions it’s been possible to override actions in different contexts, so now I can ensure that in Clojure contexts the Cursive actions take precedence, and when not in Clojure contexts they have no effect. So I’ve now decided to bite the bullet and just map the actions by default. The actions are mapped in the three main keymaps users are likely to use - the default one used on Windows and Linux, the Mac OSX 10.5+ one and the Emacs one has CIDER-like bindings mapped to it. This has meant that I can finally get rid of the monstrously confusing Keybindings panel - possibly no other code has ever given me greater pleasure when deleting it.

I’m very interested in feedback on how well the default keymaps work, in particular on Windows because I don’t use it and the default keymap previously had some pretty terrible errors. I’m also interested in what the experience is like using the Emacs keymap for those used to Emacs/CIDER. If you’re interested in trying this out I recently resuscitated a port of the Emacs+ plugin which had languished and didn’t work on recent IntelliJ versions - if you want to set IntelliJ up to be as much like Emacs as possible that’s definitely recommended. Any and all feedback welcome.

And the final keymap-related new feature is that you can now go to Help->Show Cursive Cheat Sheet, which as the name implies will open a cheat sheet showing most of the useful Cursive actions and a lot of IntelliJ ones as well. It’s an HTML file which will be opened in your default browser, and it contains some CSS which should hopefully make it print well in landscape format. Any problems with this, please let me know.

This release also brings support for IntelliJ 2017.3 and for Leiningen 2.8.0 and 2.8.1, and adds some support for the clojure.java-time library. There is also now an inspection warning you if the file containing a namespace isn’t correctly located in the on-disk package hierarchy, and a corresponding fix for a very confusing bug in the test integration. There are also some other minor improvements - namespaced maps are correctly formatted in the test result diffs, and Java 8 default methods are handled better in reify-like forms. It also now allows symbol resolution to be customised to any macro or keyword definition form.

There are a few other miscellaneous new fixes and features too - better support for Clairvoyant tracing in CLJS, better support for spec.gen.alpha, support for the new ## reader macro, a more useful message when the test integration is broken by humane-test-output, and a few other minor fixes.

Here are the issues:

Can’t turn off Move Form Up/Down in Keymap settings #1891
Creating single-segment namespace in source root incorrectly adds . to start of name #1888
Show Cursive Cheat Sheet action creates file without . before html #1887
NPE in JavaScript resolution #1884
Add lein version 2.8.1 to dropdown #1882
Allow customising resolution to any macro #1881
“Move forward” action is not listed in keymap #1880
Add support for expectations.clojure.test #1875
Close project without being asked “Do you want to close the REPL … ?” #1867
Test result diff sometimes not appearing #1865
Add keybindings by default and remove keybindings panel #1863
resolve as ’fn ? #1857
Make Cursive available for Intellij 2017.3 #1854
Support Reader Macro ## for Symbolic Values #1849
Provide completion for spec.gen.alpha vars #1835
Structure view often not useful. Make customizable? #1816
Symbol resolution for deftest-like macros #1743
Add import-vars hook for Clojure.Java-Time #1670
MacOSX keybindings issue #1610
A way to mute “Your project requires namespaces which need stubs to be generated” #1599
Add the ability to ‘define’ keywords #1549
Navigate to declaration with namespaced keyword #1470
File structure should not show (declare …) declarations #1384
No Test Failure Highlighting #1258
Can’t save binding set of “none” in Clojure Keybindings #1141
Meta key is bound to several commands in the Cursive binding set under Windows #1139
Support resolution of def and defn from within macros #974
Multimethods are not shown in Structure View #916
Delineate private functions from public functions #867
Must there be so many keymap conflicts? #759
Project structure doesn’t show classes #559
Feature Request: Warn when namespace doesn’t match Filename #317
add link to intellij-keymap-exporter plugin to Cursive documentation #124

Cheers,
Colin

Maarten Truyens

unread,
Nov 28, 2017, 5:16:58 AM11/28/17
to Cursive
Hi Colin,

Big thank you — especially the new keyword navigation saves a lot of time! I really like the fact that the Spec definitions declared with my home-brewn Spec-macros continue to work (by simply "resolving" those macros as spec/def and spec/fdef in Cursive).

Maarten

Reynald Borer

unread,
Nov 28, 2017, 6:56:39 AM11/28/17
to cur...@googlegroups.com
Howdy,

Colin thanks for the great work!

On MacOS it looks like keymap binds ⇧⌘P both to "Send top form to REPL" and "Switch REPL NS to current file", I find this quite disturbing... Is it only me?

Cheers,
Reynald


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to cur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cursive/d11d7ef5-9375-4dc5-8249-7debf57509a5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Colin Fleming

unread,
Nov 28, 2017, 3:50:56 PM11/28/17
to cur...@googlegroups.com

Hi Reynald,

That is indeed quite disturbing, and wasn’t my intent. I guess you’re using the “Mac OS X” keymap, not the “Mac OS X 10.5+” one, right?

Cheers,
Colin

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.

Reynald Borer

unread,
Nov 30, 2017, 4:14:37 AM11/30/17
to cur...@googlegroups.com
Hi Colin,

My bad, I was using a custom keymap that I tweaked a while ago and I guess I manually mapped ⇧⌘P to "Switch REPL NS to current file". I've switched back to the official mapping and I don't see a conflict anymore :-)

Cheers,
Reynald


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to cur...@googlegroups.com.

Maarten Truyens

unread,
Nov 30, 2017, 2:33:25 PM11/30/17
to Cursive
Hi Colin, 

I just noticed that namespaced keywords that are used as an identifier within Re-frame's reg-event-db function, are not found when the usages for that keyword are requested. 

Example with :abc/xyz:

(reg-event-db :abc/xyz
  (fn []
    ...))

Putting the same keyword elsewhere is not a problem. Strange thing is that the keyword is found when put inside the reg-event-db function (so inside the body of the fn). 

It also seems to happen with a few other functions of re-frame.core (such as reg-event-fx). Is there any special treatment for those functions? (Note that they are not macros.)

Maarten

Colin Fleming

unread,
Nov 30, 2017, 4:17:38 PM11/30/17
to cur...@googlegroups.com, Maarten Truyens

Hi Maarten,

No, there’s no special treatment like that. Could you file an issue for that and I’ll look at it? Namespaced keywords used to define things are now treated differently from normal keywords, so it’s possible there’s a bug slipped in there.

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.

Maarten Truyens

unread,
Dec 1, 2017, 3:01:24 AM12/1/17
to Cursive
Reply all
Reply to author
Forward
0 new messages