calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
az 2021-04-24T01:07:49.166200Z

@brandon.ringe do you think it’s best to just use comments? My thought was that it feels faster to write #_ vs opening a comment block. I guess I should maybe just go with comments.

az 2021-04-24T01:08:12.166400Z

As for something like org mode though, do you have any thoughts?

bringe 2021-04-24T01:33:23.166600Z

I'm not sure how you normally use comment , but in my workflow I generally have a comment block at the end of a namespace/code file, and I try out (evaluate) code there. So typing comment isn't a frequent thing for me. When I want to comment a particular thing in code I'm writing to try something else in its place, then I'll use #_.

bringe 2021-04-24T01:34:23.166800Z

As far as org mode, I'm not familiar with it (or emacs/cider), and I've only briefly skipped through that video thus far so I really don't know what it's about 😄

Sajjad 2021-04-24T12:35:20.171500Z

Hi 1- I installed calva on vscode 2- I run my project (https://github.com/metabase/metabase) with lein run In debug section of vscode there is no any suggestions for creating launch.json file for calva debugging and I have no idea how to attach and use debugger! I checked https://calva.io/debugger/ out, but I didn't find any clue I would be grateful for any helps 🙏

pez 2021-04-24T12:42:07.176500Z

Hi, @kalantar98. Welcome! Calva’s debugger need Calva to be connected to the REPL in your application. You can read about this here: https://calva.io/connect/ I suggest you start with familiarising yourself with Calva’s REPL connection. There is a command in Calva that helps you with this, and that also has a brief intro to the debugger. You find it in the VS Code command palette: Fire up the Getting Started REPL.

👍 1
pez 2021-04-24T12:43:59.177600Z

Here you can read a bit about the getting started guide, there is a video introducing it as well: https://calva.io/getting-started/

👍 1
Denis 2021-04-29T06:36:12.282800Z

Hi @brandon.ringe I’ve tried doing this:

(deftest create-restaurant-test
  #dbg
  (testing "create restaurant & fetch restaurant"
    (let [restaurant (assoc restaurant :bicycle-info {})
          booking (dissoc booking :bicycle-id :bicycle-name :bicycle-photo-url :bicycle-phone)]
      #break (restaurant/create booking)
      (is (= restaurant (-> (restaurant/fetch restaurant-number)
                       (dissoc :updated-at :created-at :restaurant-created-at :restaurant-updated-at)))))))
If I do > calva run current test, it does not stop at the breakpoint ;\ . Is this expected, or is this not the clojure way to debug test ?

bringe 2021-04-29T16:58:56.292700Z

Hey @denisthamrin. The reason for this, and how to make it work, is explained in the docs here: https://calva.io/debugger/#my-breakpoint-in-a-test-isnt-being-hit

👍 1
bringe 2021-04-29T18:03:04.293100Z

@pez Maybe we could load file -> eval top-level form (current test) -> run test - I think the eval after load would ensure the function is instrumented before it's run, same as the manual instructions in the docs. What do you think? It might look odd though seeing the eval decorations and annotations before the test runs, but maybe we could disable that in this case.

Sajjad 2021-04-24T12:44:55.178Z

Thank you very much

pez 2021-04-24T12:45:57.178200Z

You are welcome!

pez 2021-04-24T12:48:25.178400Z

I have never tried the metabase project in Calva. Curious about how that pans out. Please don’t hesitate to ask for help here.

Sajjad 2021-04-24T12:52:21.178600Z

I am really thankful I am an android developer for almost more than 3 years, and this is my first experience with lisp langs, I was struggling for 4 days to set up debugger in this project I was totally desperate, Thanks again for helping 🌹

pez 2021-04-24T12:53:27.178800Z

Just a heads up. The debugger only works in Clojure. For ClojureScript there is no debugger.

Sajjad 2021-04-24T12:55:49.179Z

Ok thanks! metabse backend is just Clojure

pez 2021-04-24T12:56:51.179200Z

Personally, I don’t use the debugger very often. The Clojure REPL provides alternatives that for the most times suffices. Having the editor plugged in to the running application is quite different, and much more powerful, from anything I had previously experienced.

Sajjad 2021-04-24T13:07:51.179400Z

Oh cool, seems like I should learn more about REPL but does this editor plugging has features of a debugger like pausing at some specific line of code, or navigating through callstack?

pez 2021-04-24T13:13:06.179600Z

If you have instrumented the code, the execution will pause at the breakpoint. There is no navigation through callstack, though. The existing features are listed on the debug docs page.

💯 1
Sajjad 2021-04-24T13:23:44.180Z

Thank you again

worrelsik 2021-04-24T13:43:57.180200Z

Hi Sajjad, I would be very interested in your experiences in getting up and running with Metabase. I hope you can make some notes and collect them into a blog- or wiki-entry for fellow-beginners to learn from. Good luck!

Sajjad 2021-04-24T13:48:01.180400Z

@roger429 That's a good idea, I am trying my best to set up this weird debug system for metabase 😂

worrelsik 2021-04-24T13:51:05.180600Z

I know virtually nothing about Metabase; considering if we can use it when in the long run we have access to the database from our vendor. Meanwhile, I'd like to practice using .csv files, but the support for that is still rather weak. I hope to be able to help improve that. (someday)

👍 1
jeffmcompsci 2021-04-24T15:01:08.184600Z

Hello! I’m new to Clojure & Calva. I’m going through “fire up the getting started repl” and trying to eval the form up to the curser (ctrl+alt+enter). When I try it, on L110 of hello_repl.clj, nothing seems to happen. I place my cursor after colt-express, for example or after :ratings. When I do ctrl+alt+enter, should I see any output? I’m on a MacBook Pro. Thanks!

pez 2021-04-24T15:17:57.185800Z

@jeffmcompsci maybe some other extension is also binding something to that shortcut? Or something else system level.

pez 2021-04-24T15:18:59.186100Z

This should happen.

2021-04-24T15:20:28.186400Z

Does repl show as connected at bottom?

bringe 2021-04-24T22:27:39.186700Z

Hey @kalantar98. I added the debugger support to Calva. If you have any issues or questions feel free to direct them my way. Your experience makes me realize we could improve those docs a bit more to inform newcomers better about how the debugger differs from what they might be used to (no launch.json or manual starting of the debugger). I'll create an issue to remember to do that. I agree with @pez that getting more familiar with the repl would be good to do first.

👍 1
bringe 2021-04-24T23:49:00.187500Z

I've added a note about this to the docs: https://calva.io/debugger/#using-the-debugger Thanks @kalantar98 for the feedback

👍 1