Fork me on GitHub

@pez Thanks - that’s not happening. I’ll try deleting extensions and see if I can figure out which one it is.


Hi @brandon.ringe I'm struggling with this debugger and REPL and metabse for days OK I got it, There is no need to launch.json in vscode Also I tried your Calva: Fire up the "Getting started" REPL and everything over there works fine, I did lots of alt+enter and ctrl+enter and it was working perfectly. But I really need an example that covers metabase situation that is: In the project there is a log that I know where it is placed so I put a #break over there Then I run the application with lein run and I browse the metabase from my browser do the thing that triggers that log line now I need the debugger to pause the running lein application then I can check the call stack


Just give a more realistic example of how to assemble the lein run and REPL and calva debugger


Thanks in advance!


Also metabase is and you can check anything you need to know about it


@kalantar98 Did you follow the instructions here?


Of course I did, But I get this:


Not good. Please file an issue about it. I’ll see if I can figure out a workaround for now.

👍 3

Here’s is what you can do: Start the repl like this:

lein update-in :dependencies conj '[nrepl,"0.8.3"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.26.0"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- with-profile +repl repl :headless
Then when the message nREPL server started on port … you can use the Connect command instad of Jack-in. Choose Leinigen as project type.

👍 3

Ok, I created new issue in github


but seems like combination of these commands doesn't run metabase application after all, right?


I still need something like lein run, how to do it?


Combination of which commands?


lein update-in :dependencies conj '[nrepl,"0.8.3"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.26.0"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- with-profile +repl repl :headless and then connect to running REPL


The app should be running if you issue the command I pasted above. Is it not?


No, lein run, runs the application, it sets up database and listens to port 3000, but this command does just some of driver builds and thats it, nothing more, You can see yourself if you have anydesk


Or you can clone metabase and try yourself


Try replacing the +repl in the command with +run-with-repl


Ok, I will try it


What is anydesk, btw?


Anydesk is a free software for remote control You can access my system and do whatever I granted permission to you! You can see my monitor, and use your mouse and keyboard to do anything


Yeeeeeeeeeeeees @pez, You did it, Now debugger works +run-with-repl worked Thank you very very much But still I have an issue, call stack doesn't show whole call stack, it just shows current function:


I’m not completely in the know with what you can expect here, but the lack of a call stack might be a limitation. I think it is within reach to implement, though. You are welcome to file an issue, and of course also welcome to provide a PR.


Glad you got it running! I will have to look into how we make jack-in work with this project.


All solutions were yours, thank you again!


There is at least more than 3 files that gets involved before reaching the running code to here, it's not possible this specific line of code get's running firstly just by itself, of course it is called from somewhere else, I wanted to know whose the caller


Yeah, for that use case the call stack is super. Please file an issue about it.


And we should probably mention that there is no call stack yet in the docs, right, @brandon.ringe?


OK, But is there any solution for me right now?


project is really big, I need to know who calls that specific part so I can understand that part and debug the bug


Well, outside of Calva there is CIDER, which does implement the call stack for this debugger. And then there is Cursive which has the most sophisticated Clojure debugger I know of. Sticking with Calva you can instrument more functions that you suspect are called, or hook in Reveal and tap> things in the suspected paths. Or try the flow-storm debugger (which is a trace debugger, I don’t know how useful for this use case).


You can of course also sprinkle (println …) around and see what gets printed. I often do that.


Thank you, I will try them, but no println won't help me in my case


I'll look into the call stack thing. @kalantar98 I'm glad you got debugging working. You can also look at tools.trace for trace debugging, which may be helpful to you.

👍 3

I haven't really used it myself, so I'm not sure if it can do what you need.

👍 3
🙏 3

OK, thank you


I tried all the options it had


@jeffmcompsci, did you have any luck finding out if something was hogging the ctrl+alt+enter binding? Another thing you can try to just check that the basic functionality is working, is to run the command from the command palette.


Not yet. My day job is interfering with my fun. I’ll be investing more time in Clojure this weekend and let you know which one it is. ;)


Found it! I use a utility called Magnet to place my windows. It had a key binding (ctrl-alt-enter) to maximizing a window. I changed it & all is well with Calava! 🙂 Thanks!


Awesome. I also use Magnet, actually. Should have thought about that clash.

👍 2

This is a VSCode question, not a Calva question, but I thought I’d try my luck here first as I imagine there’s a better chance someone here will have experienced this particular issue: I’m developing on Windows via WSL. So I’ve got a Git repository checked out within the WSL file system, and I’m editing it using VSCode via the network share that’s automatically created by WSL. This all works fine, except… I have one particular file within my repository called bin/build , a shell script that’s used during the Heroku build process. Whenever I open the project within VSCode that one file (and only that one file: none of my Clojure source code or anything else is affected) shows as modified within VSCode’s Source Control tab. It’s modified because it’s had its line endings changed to Windows CRLF style endings. This is all without me opening or editing the file in any way. Does anyone have any idea what might be going on here? Any clue what I could do to fix it? Thanks in advance!


Does it help to save it in that state? Not suggesting it as a solution, just curious.


Interesting! No, it doesn’t. It still shows up as modified.


I just tried getting rid of the executable flag too in case that was the cause (it’s the only executable file in my repo)


And still the same behaviour


Super odd. I think making a tiny repro of this and filing as an issue on the VS Code repository is the way to go.


Will do. Thanks for your help.


“help” 😃


@qythium (at least I think it was you), you posted about comment styling the other day/week. Seemed you had found a solution using a gutter icon. Is it something you did using the comment styling setting that Calva provides, or did it involve something more? Asking because I just realized that I can style (comment …) forms such that they show up with a special color in the overview ruler. Like so:

"calva.highlight.commentFormStyle": {
        "overviewRulerColor": "green",
        "overviewRulerLane": 1
Where the lane is taken from this enum in the vscode type defintion file:
export enum OverviewRulerLane {
        Left = 1,
        Center = 2,
        Right = 4,
        Full = 7
Was it something similar you did for the gutter?


Yup, I looked up the textDecoration API and found the key. Here's what I had set it to, where the png is just a 1x1 coloured pixel:

"calva.highlight.commentFormStyle": {
        "gutterIconSize": "cover",
        "gutterIconPath": "/Users/yuhan/Desktop/010.png",


I did try the overviewRuler too, but found that once you scrolled offscreen it would disappear


Yes, Calva only decorates forms in view.


The overview ruler seems like an exception though, it's supposed to be for scanning the entire buffer - although specifying that via text decorations is probably not right


I think Calva Highlight might be worth a documentation page of its own. Then we could host these ^ tricks on that page.


That the overview ruler can be hit with styling is more of an internal “accident”. But it could be good to know about that it can be done, I think.


oh, one more weird thing I found - the "Print Stacktrace" button is repeated many many times for any error message, stretching far off the screen. Not sure if this is intended?


Not intended. It’s an ugly glitch. Don’t know if it has been reported, but it should. I imagine it should be easy to fix.


Coming from Cider, the error reporting in general isn't great, and I imagine that's one of the things which might be offputting to beginners


• most of the error message is hidden offscreen in the repl window which doesn't word-wrap, and I have to resize the window to see the full message, then resize it back again to see my main window


• 90% of the stack trace is irrelevant cider-nrepl.middleware or clojure.repl wrappers - there is orchard/cider-nrepl functionality to filter these things out interactively


Make it word wrap?


We had filtering in the old implementation, but it hasn’t fond its way back since. A start could be that there are several buttons for printing the trace. Or maybe two. Full + some sanely filtered one.


Personally I almost never look at the stack traces, so am not feeling this pain properly.


That would be quite a welcome change 🙂 I think a nice default would be for "Project" stacktraces to be printed by default, and a "Show More" button to see the full trace


The lowest hanging fruit is to just have two buttons. “Stack trace (project)“, “Stack trace (full)“.


PR welcome. 😃


heh, I know very little about VS code's extensions, just been test-evaluating Calva because new members on our team are using it


At a minimum you can file an issue. 😃

👌 3

Btw, I think you would fix this within one hour. Knowing nothing about VS Code extensions, getting the dev env up, finding where to apply the change, and change it. Hacking on Calva is most often very easy. Just FYI.


I've seen this before too but haven't been able to repro consistently. If you can repro consistently it may be much easier for you to fix if you did find the time. No worries if not though. simple_smile


For the record, my assessment was about adding the filtering. 😃

👍 2

I wasn't sure, myself, lol. Thanks. But, @qythium, if you can provide a consistent repro for the duplicate code lenses, that alone would be awesome as well.


It only seems to happen in our full codebase with lots of dependencies, I'll see if it can be reproduced at a smaller scale


I haven’t seen a pattern to it. But I’ve seen it quite often.