Fork me on GitHub
#cursive
<
2023-03-02
>
onetom12:03:24

i don't understand this new Execute new bookmarked form action. it seems to always just execute the 1st bookmark. i briefly see some bookmark list dialog box popping up, but i have no chance to select from it. i tried to run this action both via the Find Actions... popup or via an shortcut assigned solely to this new action, but the behaviour is the same in both cases. IntelliJ IDEA 2022.3.2 (Ultimate Edition) Build #IU-223.8617.56, built on January 26, 2023 Cursive 1.12.8-eap3-2022.3 macOS Ventura 13.2.1 (22D68)

damirb20:03:02

👍 for the execute bookmarked form.. will try to play with it tomorrow. i had something like that hacked with repl commands, but this should be easier/nicer

cfleming20:03:29

@U086D6TBN Does the history search popup show correctly for you? You should see the same style of popup shown for the history search.

onetom21:03:54

yes, the REPL history search works as expected

cfleming22:03:54

That’s very strange. It seems like the dialog is getting dismissed immediately for some reason.

cfleming22:03:45

And the dialog uses the exact same code as the REPL history one.

onetom22:03:34

let me know, if i can assist in any way to fix this issue

cfleming22:03:55

Ok, I’ll see if I can think of anything. At that level, it’s mostly IntelliJ doing its thing.

onetom22:03:59

it was also unexpected, that not the whole top-level form was executed, only part of it. i guess u are assuming the cursor position is at the beginning of the bookmarked line. assuming the end of line would be better, i suspect.

cfleming22:03:29

Yes, it picks the first form on the bookmarked line.

cfleming22:03:42

Isn’t that what you would expect?

onetom22:03:35

IntelliJ EAP Build #IU-231.7665.28, built on February 23, 2023 has the same issue with the Execute bookmarked form action, btw

onetom22:03:03

what i would expect is to bookmark some rich-comment expression, anywhere in the middle of the expression, so i can keep re-evaluating it, while im modifying the underlying implementation, in some other namespace most likely

cfleming22:03:51

So you’re expecting the equivalent of “Evaluate top level form surrounding the bookmark”?

cfleming22:03:22

In that case, you could currently get what you want, by bookmarking the -> form.

onetom22:03:37

when would the current functionality even be useful? only if im on the 1st line of some form?

cfleming22:03:39

I’ll be interested to hear what others think about what they would expect here.

onetom22:03:37

if only there would be an action to select the current top-level form or to jump to the beginning or end of the current top-level form (taking the comment into consideration too), that would make it easier to bookmark at the beginning.

onetom22:03:53

it would also be easier to navigate between top-level forms, if i could just jump to the beginning of one, because then i can use Opt-Left/Right to pick another top-level form.

onetom22:03:04

if u would like to conduct some UX / usability studies, i would be very much up for being the guinea pig for that 🙂

cfleming23:03:28

Right, there’s jump to previous/next method, but that doesn’t do every top-level form.

thheller08:03:30

@cfleming is there a way to customize the "run test in REPL command", so that it runs through regular clojure.test? not this custom form it seems to use instead?

(clojure.core/binding [clojure.test/report cursive.tests.report/report]
  (clojure.core/binding [clojure.test/*report-counters* (clojure.core/ref clojure.test/*initial-report-counters*)]
    (clojure.core/let
      [ns-obj__10607__auto__
       (clojure.core/the-ns (clojure.core/symbol "shadow.cljs.repl-test"))]
      (clojure.test/do-report {:ns ns-obj__10607__auto__, :type :begin-test-ns})
      (clojure.core/let
        [v__10608__auto__
         (clojure.core/ns-resolve ns-obj__10607__auto__ (clojure.core/symbol "test-repl-require-current-ns"))
         once-fixture-fn__10609__auto__
         (clojure.test/join-fixtures (:clojure.test/once-fixtures (clojure.core/meta ns-obj__10607__auto__)))
         each-fixture-fn__10610__auto__
         (clojure.test/join-fixtures (:clojure.test/each-fixtures (clojure.core/meta ns-obj__10607__auto__)))]
        (once-fixture-fn__10609__auto__
          (clojure.core/fn []
            (clojure.core/when (:test (clojure.core/meta v__10608__auto__))
              (each-fixture-fn__10610__auto__
                (clojure.core/fn []
                  (clojure.test/test-var v__10608__auto__)))))))
      (clojure.test/do-report
        {:ns ns-obj__10607__auto__, :type :end-test-ns}))
    (clojure.test/do-report
      (clojure.core/assoc
        (clojure.core/deref clojure.test/*report-counters*)
        :type :summary))))

thheller08:03:07

I want to customize how exceptions are shown, since currently is doesn't show the full stacktrace which is annoying to no end

2
thheller08:03:27

do I have to go with a fully custom REPL command or is there something I can use to modify the existing one?

thheller08:03:14

I guess I can mess with cursive.tests.report/report but not sure how much cursive will like that 😛

thheller09:03:17

oh nevermind. forgot that I had already custom commands for all that. keybindings just seem to have reverted after setting up my new machine

onetom22:03:40

we are also using a custom command for running tests in the REPL but via kaocha (which is not always present) what is your custom command? ours is

(do (when-not (resolve 'user/focused-test) (intern 'user 'focused-test (atom nil)))
    (when (:test (meta #'~current-var)) (reset! user/focused-test '~current-var))
    (time
      (if-let [t @user/focused-test]
        (do (require (symbol (namespace t)) :reload)
            ((requiring-resolve 'kaocha.repl/run) t))
        ((requiring-resolve 'kaocha.repl/run) :unit :behaviour {}))))
with the options shown on the screenshot.

thheller09:03:42

custom REPL command FTW! 🙂