Fork me on GitHub
#calva
<
2019-08-24
>
bringe00:08:55

Here is a demo using an example from https://clojuredocs.org/clojure.pprint/pprint To evaluate big-map I used ctrl+enter

bringe00:08:33

And then the pprint version

bringe00:08:51

I'll open an issue specifically for pprint in the repl window if you want. I don't see one for that currently.

pez06:08:37

Yeah, please open an issue about pretty print in the repl window. I think fipp is used there, but I'm not sure. And maybe we should use pprint all over.

Janne Sauvala22:08:09

I was adding REBL to my development flow with Calva. I got the setup working but I noticed that I cannot do “Go to definition” and other similar features in Code anymore. I start the Jack-in with the following aliases in my deps.edn:

;; nREPL with REBL
  :nrepl-rebl {:extra-deps {nrepl {:mvn/version "RELEASE"}}
               :main-opts ["-m" "nrepl.cmdline" "--middleware" "[nrepl-rebl.core/wrap-rebl]"]}
  
  ;; REBL
  :rebl {:extra-deps
         {org.clojure/clojure {:mvn/version "1.10.0"}
          org.clojure/core.async {:mvn/version "0.4.490"}
          com.cognitect/rebl {:local/root "/Users/janne/Dev/REBL/REBL-0.9.218.jar"}
          org.openjfx/javafx-fxml     {:mvn/version "11.0.1"}
          org.openjfx/javafx-controls {:mvn/version "11.0.1"}
          org.openjfx/javafx-graphics {:mvn/version "11.0.1"}
          org.openjfx/javafx-media    {:mvn/version "11.0.1"}
          org.openjfx/javafx-swing    {:mvn/version "11.0.1"}
          org.openjfx/javafx-base     {:mvn/version "11.0.1"}
          org.openjfx/javafx-web      {:mvn/version "11.0.1"}
          nrepl-rebl {:mvn/version "0.1.1"}}}
With this setup I’m getting the REBL window and Calva’s nREPL connection. The REBL and nREPL are also synced, meaning that I see the evaluated values inlined in Code and also in REPL. The setup is otherwise ideal, but I would like to get the code navigation working again. Is this possible or have I done something silly with my configs? 😅

Janne Sauvala22:08:34

I noticed that the code navigation has something to do with starting the nrepl with :main-opts ["-m" "nrepl.cmdline"] option. If I that opts the code navigation breaks

pez07:08:26

This is a longshot, but maybe it is because nrepl-rebl brings in nrepl 0.5.2. Not sure how you would test that guess...

Janne Sauvala17:08:36

Okay thanks for the insight. I’ll try another library that syncs nrepl and rebl. It might use newer nrepl :thinking_face:

pez17:08:32

There might be a way to exclude the dependency. Or just try using a local version of the library where you remove the dependency.

pez17:08:38

I am far from sure about it as well, so there might be something else that needs fixing. You are welcome to add this as an issue on Calva. It would be awesome to be able to support REBL workflows.

Janne Sauvala23:08:38

I got my setup working by starting the repl first from the command line clj -A:nrepl:rebl -m nrepl.cmdline --middleware '[nrebl.middleware/wrap-nrebl]' -i and then hooking Calva to it. I changed the nrepl-rebl syncing middleware to a more active looking library.

Janne Sauvala23:08:01

And I had in my deps.edn:

:nrepl {:extra-deps {nrepl {:mvn/version "0.6.0"}}}

  ;; REBL
  :rebl {:extra-deps
         {org.clojure/clojure {:mvn/version "1.10.0"}
          org.clojure/core.async {:mvn/version "0.4.490"}
          com.cognitect/rebl {:local/root "/Users/janne/Dev/REBL/REBL-0.9.218.jar"}
          org.openjfx/javafx-fxml     {:mvn/version "11.0.1"}
          org.openjfx/javafx-controls {:mvn/version "11.0.1"}
          org.openjfx/javafx-graphics {:mvn/version "11.0.1"}
          org.openjfx/javafx-media    {:mvn/version "11.0.1"}
          org.openjfx/javafx-swing    {:mvn/version "11.0.1"}
          org.openjfx/javafx-base     {:mvn/version "11.0.1"}
          org.openjfx/javafx-web      {:mvn/version "11.0.1"}
          rickmoynihan/nrebl.middleware {:mvn/version "0.2.0"}}}

Janne Sauvala23:08:14

And then I called (cognitect.rebl/ui)in Calva’s REPL to get REBL window

Janne Sauvala23:08:53

This setup is great for my workflow ❤️ I’m not going to open a new issue because I saw this feature request in Github: https://github.com/BetterThanTomorrow/calva/issues/240. I think it summarizes quite well how I would like this setup be improved 🙂

pez04:08:15

Fair enough. 😀 But please consider adding your findings to the issue.

Janne Sauvala18:08:04

I got something wrong with my setup that I described above (it’s not working correctly). Here I described the situation and how I got it solved: https://github.com/BetterThanTomorrow/calva/issues/240#issuecomment-525437286