@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.
As for something like org mode though, do you have any thoughts?
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 #_
.
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 😄
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 🙏
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.
Here you can read a bit about the getting started guide, there is a video introducing it as well: https://calva.io/getting-started/
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 ?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
@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.
Thank you very much
You are welcome!
I have never tried the metabase project in Calva. Curious about how that pans out. Please don’t hesitate to ask for help here.
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 🌹
Just a heads up. The debugger only works in Clojure. For ClojureScript there is no debugger.
Ok thanks! metabse backend is just Clojure
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.
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?
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.
Thank you again
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!
@roger429 That's a good idea, I am trying my best to set up this weird debug system for metabase 😂
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)
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!
@jeffmcompsci maybe some other extension is also binding something to that shortcut? Or something else system level.
This should happen.
Does repl show as connected at bottom?
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.
I've added a note about this to the docs: https://calva.io/debugger/#using-the-debugger Thanks @kalantar98 for the feedback