Fork me on GitHub
#cursive
<
2022-11-02
>
apbleonard08:11:09

Any thoughts about adding a REPL submenu item or similar to "zap" a namespace like this? https://github.com/seancorfield/vscode-calva-setup/blob/4399acdc762188df25fecd52436bb6b61efc9d90/calva/config.edn#L25 I know it's possible to similarly set up custom commands in Cursive, but it would really aid those starting out with REPL ing to be able to start afresh with a namespace that's gone bad, without having to constantly restart the REPL, which saps their faith in it.

cfleming08:11:34

It’s something I could think about adding, but really it seems like a good use case for the REPL commands to be honest. Perhaps a more general solution would be to have a good way of sharing REPL commands.

apbleonard09:11:24

@U0567Q30W Custom REPL commands (bindable to keyboard shortcuts) are awesome, and power users need that for their preferred "refresh" workflows. But for new users Cursive has "out of the box" a core set of operations that is essential for using the REPL. I guess my feeling is that some opinionated choice of "refresh" or "clean" or "zap" namespace operation is "essential" for new users. It's well established in UX that the ability to start afresh is critical to usability - no matter the tool. Right now all new users have to start afresh is the REPL restart button, which you are told is a slow frustrating last resort - and yet they use it constantly - or worse they give up on the REPL entirely seeing it as unreliable. Clojure sells itself as a playful interactive experience, where learning is done by doing, but that only works if you can start afresh reliably. I work in an enterprise setting with a smattering of Clojure in a sea of Java, and a rolling set of partner staff who are not Clojure enthusiasts and may never be. They are not determined enough to read up on "tips and tricks" around the internet on how best to use the REPL and expect tooling guidance. Many are confused by the REPL and avoid it. So my plea is to consider helping to grow Clojure and the Cursive user base towards those non enthusiasts by adding a small feature that will help them start afresh :)

Empperi14:11:40

I got back to writing some Clojure code and I'm seeing a problem that was not there before. When executing tests in the REPL and getting test failures I do not get the gutter icon/inline results anymore in the editor. This makes the test execution in REPL almost useless since I do not get the assertion differences and information on which test failed. Anyone else seeing this?

Jordan Robinson14:11:12

it's now a context action, and can be bound to a keyboard shortcut, so you may see it with alt+enter

Jordan Robinson14:11:21

though I've noticed if one of the sides is nil sometimes that doesn't show

Empperi14:11:52

Don't see it?

Empperi14:11:34

There's literally nothing in the editor that shows I actually executed tests

Empperi14:11:46

I do get the small notification box

Jordan Robinson14:11:12

ah that's a bit more significantly weirder, though I've seen a similar thing if your test file is named the same as a src file

Empperi14:11:21

Different name

Jordan Robinson14:11:41

this is what it should look like when it fails

Empperi14:11:56

Nope. If that would happen I would have not asked 🙂

Jordan Robinson14:11:10

sorry that meant to have this bit in with the context menu:

Empperi14:11:10

So, it is a bug/issue and manifests on my system

Jordan Robinson14:11:43

yeah sorry, I don't have any other ideas

Empperi14:11:07

No worries. Just wanted to know if it is turned off by default and can't just find the proper setting that would turn it on or something like that

Empperi14:11:19

Been diving into settings

Empperi14:11:32

But this does make executing tests with Cursive pain

Empperi14:11:04

I can execute a single test with that gutter icon but that executes the test in a separate jvm process which takes tons of time. In the output there's a link "click to see the differences" which opens the diff

Empperi14:11:22

Totally losing the fast iteration speed with REPL

Jordan Robinson14:11:46

yeah that's not great - if you start a new project with leiningen or similar and run the test that comes with that, does that work?

Jordan Robinson14:11:54

could rule out the code vs the ide settings at least

Empperi14:11:04

I'll try that just to be sure, one moment

👍 1
Empperi14:11:35

Totally blank project created from scratch with lein new testing-cursive and opened as a new project suffers from the same issue

Jordan Robinson14:11:31

well that rules out a lot of stuff at least but I don't have any other ideas I'm afraid, maybe someone else in the channel does

Empperi14:11:49

Yeah. I'll try to cope with this until someone might figure out wth is going on

Empperi14:11:55

I'm out of ideas myself too

Empperi14:11:08

Just in case Fleming happens to look at this or someone else with more knowledge, here is my about dialog content:

IntelliJ IDEA 2022.2.3 (Ultimate Edition)
Build #IU-222.4345.14, built on October 5, 2022
Licensed to Niklas Collin
Subscription is active until February 22, 2023.
Runtime version: 17.0.4.1+7-b469.62 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Non-Bundled Plugins:
    org.jetbrains.kotlin (222-1.7.20-release-201-IJ4167.29)
    mobi.hsz.idea.gitignore (4.4.2)
    com.intellij.kubernetes (222.4345.14)
    intellij.prettierJS (222.4345.14)
    com.nekofar.milad.intellij.nextjs (1.2.3)
    com.intellij.lang.jsgraphql (3.3.0)
    com.cursiveclojure.cursive (1.12.5-eap2-2022.2)

Kotlin: 222-1.7.20-release-201-IJ4167.29

Empperi14:11:41

Might try this also on my home desktop computer if it suffers from this issue or not

cfleming07:11:53

@U7MRZK43B Do you have anything in your log file that might indicate what’s going on? Are you getting error reports in your IDE?

Empperi08:11:28

No error messages

Empperi08:11:43

Stuff just doesn't show

cfleming08:11:38

That is really wierd.

cfleming08:11:31

I’ll look through the code tomorrow morning to see if I can see anything that might cause this.

cfleming08:11:46

Are you using nREPL?

cfleming08:11:56

I guess so, since you mentioned lein.

cfleming08:11:41

Could you try this? Go to Help-&gt;Diagnostic Tools-&gt;Debug Log Settings and add #cursive.testing.actions in the dialog box. Then repro the issue, and hopefully you should see some lines in the log file from cursive.testing.actions.

Empperi08:11:21

2022-11-03 10:13:22,076 [269000779]   INFO - #c.i.d.DebugLogManager - Set DEBUG for the following categories: #cursive.testing.actions, cursive.testing.actions
2022-11-03 10:13:28,408 [269007111]   FINE - #c.t.actions - {:type :begin-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:13:28,409 [269007112]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:13:28,410 [269007113]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 51, :class "backend.collection_utils_test$fn__10106$fn__10107", :method "invoke"} {:file "collection_utils_test.clj", :line 50, :class "backend.collection_utils_test$fn__10106", :method "invoke"}]}
2022-11-03 10:13:28,410 [269007113]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 60, :class "backend.collection_utils_test$fn__10106", :method "invokeStatic"}]}
2022-11-03 10:13:28,410 [269007113]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:13:28,411 [269007114]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:13:28,411 [269007114]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 25, :class "backend.collection_utils_test$fn__10079$fn__10080", :method "invoke"} {:file "collection_utils_test.clj", :line 24, :class "backend.collection_utils_test$fn__10079", :method "invoke"}]}
2022-11-03 10:13:28,412 [269007115]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 33, :class "backend.collection_utils_test$fn__10079", :method "invokeStatic"}]}
2022-11-03 10:13:28,412 [269007115]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:13:28,412 [269007115]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:13:28,412 [269007115]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 46, :class "backend.collection_utils_test$fn__10092$fn__10093", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10092", :method "invoke"}]}
2022-11-03 10:13:28,413 [269007116]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 47, :class "backend.collection_utils_test$fn__10092$fn__10097", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10092", :method "invoke"}]}
2022-11-03 10:13:28,413 [269007116]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 48, :class "backend.collection_utils_test$fn__10092", :method "invokeStatic"}]}
2022-11-03 10:13:28,413 [269007116]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:13:28,413 [269007116]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:13:28,413 [269007116]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 8, :class "backend.collection_utils_test$fn__10066$fn__10067", :method "invoke"} {:file "collection_utils_test.clj", :line 7, :class "backend.collection_utils_test$fn__10066", :method "invoke"}]}
2022-11-03 10:13:28,414 [269007117]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 16, :class "backend.collection_utils_test$fn__10066", :method "invokeStatic"}]}
2022-11-03 10:13:28,414 [269007117]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:13:28,414 [269007117]   FINE - #c.t.actions - {:type :end-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:13:28,414 [269007117]   FINE - #c.t.actions - {:type :summary, :pass 9, :fail 0, :error 0, :test 4}

Empperi08:11:29

Oh... And should probably fail the test too 😂

Empperi08:11:32

One more time!

Empperi08:11:09

2022-11-03 10:15:42,378 [269141081]   FINE - #c.t.actions - {:type :begin-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:15:42,378 [269141081]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:15:42,380 [269141083]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 51, :class "backend.collection_utils_test$fn__10232$fn__10233", :method "invoke"} {:file "collection_utils_test.clj", :line 50, :class "backend.collection_utils_test$fn__10232", :method "invoke"}]}
2022-11-03 10:15:42,380 [269141083]   FINE - #c.t.actions - {:type :fail, :left "{:FOO \"BAR_lo\", :KIKKA \"KUKKA_lol\"}", :right "{:FOO \"BAR_lol\", :KIKKA \"KUKKA_lol\"}", :trace [{:file "collection_utils_test.clj", :line 60, :class "backend.collection_utils_test$fn__10232", :method "invokeStatic"}]}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 25, :class "backend.collection_utils_test$fn__10205$fn__10206", :method "invoke"} {:file "collection_utils_test.clj", :line 24, :class "backend.collection_utils_test$fn__10205", :method "invoke"}]}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 33, :class "backend.collection_utils_test$fn__10205", :method "invokeStatic"}]}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 46, :class "backend.collection_utils_test$fn__10218$fn__10219", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10218", :method "invoke"}]}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 47, :class "backend.collection_utils_test$fn__10218$fn__10223", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10218", :method "invoke"}]}
2022-11-03 10:15:42,385 [269141088]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 48, :class "backend.collection_utils_test$fn__10218", :method "invokeStatic"}]}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 8, :class "backend.collection_utils_test$fn__10192$fn__10193", :method "invoke"} {:file "collection_utils_test.clj", :line 7, :class "backend.collection_utils_test$fn__10192", :method "invoke"}]}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 16, :class "backend.collection_utils_test$fn__10192", :method "invokeStatic"}]}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :end-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:15:42,386 [269141089]   FINE - #c.t.actions - {:type :summary, :pass 8, :fail 1, :error 0, :test 4}

cfleming08:11:33

Ok, thanks. That narrows it down for me tomorrow. It looks like the testing events are coming through ok, I’ll see if I can find anything that might stop the UI from showing.

Empperi08:11:52

Great, thanks for your help!

Empperi08:11:01

I can live with this for a while but it is annoying

cfleming08:11:15

No worries. It’s probably a good idea to remove that line from the log settings, or you’ll get tons of junk in your logs.

cfleming08:11:22

Yeah, I can imagine - sorry 😞

Empperi08:11:32

Hey, stuff happens

Empperi08:11:38

One more thing that might have something to do with this

Empperi08:11:44

I have Fleet beta installed

Empperi08:11:56

I can see logging from Fleet in the idea logs

Empperi08:11:13

It is a far reaching thing but just an idea

cfleming08:11:35

That’s…. not expected, at least not by me, but I don’t know much about Fleet. I can’t see how it would interfere though.

Empperi08:11:52

Yeah. It only connects to Idea if it is available for Idea language servers

cfleming08:11:14

Ah, ok, that makes sense, it might be the server components for that.

cfleming08:11:38

Ok, I’ll look at this tomorrow and report back.

Empperi08:11:44

I would be extremely surprised if Fleet would be the cause but just one more thing in my env

Empperi08:11:56

Yup. Good night! I think its time there 🙂

Empperi08:11:00

Here it's 10am

cfleming08:11:08

It’s definitely getting that way!

cfleming07:11:07

So I looked at this today, and I can’t immediately see any reason this should happen. I’ll add some more debug logging and get you to try that out, hopefully I should have that tomorrow.

👍 1
grega100k15:12:29

I recently started seeing this issue where the result of the test is not indicated in the gutter. This thread is 2 months old and I'm not seeing anything more about it. Is there a fix?

Empperi15:12:44

Can't confirm. I'm between jobs and don't have the laptop anymore. Let's wait for Fleming to jump in from his timezone

Emir Bojagić10:06:33

Did anybody solve this issue? 😐

cfleming10:06:36

@U05DUKFMPTP I don’t think so, no, but if you’re suffering from it we might be able to debug it. Could you try the steps here: https://clojurians.slack.com/archives/C0744GXCJ/p1667463161084679?thread_ts=1667397700.150869&amp;cid=C0744GXCJ

cfleming10:06:19

It’s late here, but if you could try that and DM me the results, I’ll look at it tomorrow.

Emir Bojagić10:06:56

I'll try it out and send you. Thanks!

👍 2
jmmk18:11:25

Is there any difference in functionality between running a Local nrepl vs connecting to a Remote nrepl?

cfleming08:11:42

No, they should be about the same. One slight difference is that uncaught stdout printing will come out in the REPL console for a local REPL, but will go to wherever the REPL server’s output goes in that case.