Fork me on GitHub
#calva
<
2021-04-24
>
Sajjad12:04:20

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 šŸ™

pez12:04:07

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.

šŸ‘ 3
pez12:04:59

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

šŸ‘ 3
Sajjad12:04:55

Thank you very much

pez12:04:57

You are welcome!

pez12:04:25

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

Sajjad12:04:21

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 šŸŒ¹

pez12:04:27

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

Sajjad12:04:49

Ok thanks! metabse backend is just Clojure

pez12:04:51

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.

Sajjad13:04:51

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?

pez13:04:06

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.

šŸ’Æ 3
Sajjad13:04:44

Thank you again

worrelsik13:04:57

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!

Sajjad13:04:01

@UFLE01UV8 That's a good idea, I am trying my best to set up this weird debug system for metabase šŸ˜‚

worrelsik13:04:05

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)

šŸ‘ 3
bringe22:04:39

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 @U0ETXRFEW that getting more familiar with the repl would be good to do first.

šŸ‘ 3
bringe23:04:00

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

šŸ‘ 3
Sajjad04:04:51

@U9A1RLFNV Note was useful, Thanks

šŸ‘ 3
Denis06:04:12

Hi @U9A1RLFNV 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 ?

bringe16:04:56

Hey @U020A902CSH. 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

šŸ‘ 4
bringe18:04:04

@U0ETXRFEW 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.

jeffmcompsci15:04:08

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!

pez15:04:57

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

pez15:04:59

This should happen.

Stuart15:04:28

Does repl show as connected at bottom?