cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
588 stars 7 forks source link

Structure view often not useful. Make customizable? #1816

Closed tylerperkins closed 7 years ago

tylerperkins commented 7 years ago

I'm working a lot with ClojureScript and re-frame, and much of the important logic takes place in files consisting of re-frame event handlers, subscription handlers, etc., which are defined at the top level in the file with a statement like

(rf/reg-event-fx
  :an-event-handler
  (fn [_ _]
    ...))

Since these forms don't start with (def, (defn, etc., they are not shown in the Structure view. But that's often the whole file!

Of course, there are so many libraries that define their own top-level forms, clearly, Cursive cannot anticipate them all. It would be great if Cursive knew about all standard Clojure forms that appear at the top level, including standard libraries like cljs.spec. And beyond that, perhaps all top level forms should be listed in Structure view. Maybe it should be configurable and provide a way to to exclude all non-standard forms or just specified ones, or to include only forms of specific names and to specify an icon with each.

Thanks for the great work!

cursive-ide commented 7 years ago

This is fixed for the next build, and the structure view is greatly improved. It now shows re-frame elements as well as specs, and has much better support for existing elements like multimethods (#916), deftype/defrecord/definterface (#559), and many more improvements.