@pez or @brandon.ringe please review https://github.com/BetterThanTomorrow/calva/pull/3227
Thanks! I want to take a closer look and maybe test it later this evening, unless pez gets to it sooner.
@pez @brandon.ringe a couple of days ago, I managed to extend the current Calva debugger to support adding breakpoints through the UI. It works similarly to the instrumentation form used for debugging, but instead of inserting #debug, it inserts #break. It also supports conditional breakpoints. Do you think it would make sense for me to continue working on this extension for the Calva debugger?
A thing that I have tried pretty hard, but failed at, regarding the debugger, is to enable the stack frames. Just mentioning that, in case you get addicted to fixing things with the debugger. π
Ok. Will take that into account π
@vnareiko.lt Sounds interesting! How does it utilize the UI for this?
Very cool! Can that workflow support adding a breakpoint to an inner form on a given line, and not just an outer form? Like
(filter (fn [x] #break (> x 1)) [1 2])Even if not, I think the functionality is useful even with that limitation. I'm just curious.
VS Code breakpoint UI can be per statement which should translate to per form for us. So hereβs guessing that it is possible. π
I will create a feature request in GitHub and try to complete the implementation. If you have any suggestions, questions, or additional requirements, please add them so that I can create a proper issue that captures all requirements.
Also, if you have any code snippets that cover edge cases, please share them with me so I can use them for testing purposes.
There is a potential Ux issue with that the debugger is JVM Clojure only, not available for ClojureScript or any other dialect. We should understand if the breakpoints UI can be dynamically enabled, or if it is a static only thing. If the former, all good, we only enable it when the debugger op/ops is available in the nrepl server. If the latter it is not a show stopper, but at least we need to figure out how to document it/show info when breakpoints are placed, etc.
Since the debugger is JVM-only, the proper implementation would be to enable breakpoints dynamically and document this behavior as well. Will check if it is possible to have a dynamic behavior :)
Small nuance (to borrow an expression from my friend Opus): Iβd label it as nrepl-server dependent, rather than JVM. So if some other dialect starts to support debugging, we shouldnβt need to update Calva.