Fork me on GitHub
#calva
<
2022-06-10
>
Eric12:06:04

Is there a default shortcut for running -main, like there is for load/eval the file? What I’m trying to do, generally, is make it easier to make a code change, then quickly run a specific function to see the effects. How do folks typically handle this workflow with Calva?

pez12:06:59

A custom repl command snippet should work for this.

Eric13:06:50

Cool, thanks. Looking into that now.

Eric13:06:32

That was pretty straightforward!

"calva.customREPLCommandSnippets": [
    {
        "name": "Run -main",
        "key": "m",
        "snippet": "(-main)"
Thanks, @U0ETXRFEW!

pez13:06:59

You are welcome. Maybe you should include a namespace in case you are working in some other file.

Eric13:06:08

I can see how that would be useful, but I imagine I’ll want the same feature for running -main in every project I work on. So wouldn’t I end up needing to modify the shortcut each time I switch projects?

pez13:06:49

You can define the shortcut in workspace settings.

pinkfrog14:06:23

In improving my workflow, I am thinking about ditching the interactive repl pane and use it only when very necessary. However, one thing annoying when hidding the repl is that, say if I do a calva evaulate current file and if something bad happens, e.g., thrown exception, I can only go to the repl to see what’s going on. I think if it would be better to also show the output somewhere inside the bottom part of vscode (see figure). Possible? Or any better approach?

3
pez15:06:10

Issue welcome. Let’s discuss it there. I think this sounds important to solve. Maybe this is a reason I keep that pane open so much.

ericdallo16:06:13

This is one of the behaviors of cider that I like too

seancorfield17:06:45

Yeah, the only reason I keep the Calva output window open at all -- resized to just a few lines on the right hand side below my Portal window -- is to see if I get errors running tests or loading an entire file. Everything else I can see inline or in Portal.

seancorfield17:06:49

I've toyed with the idea of a Joyride script to show and then hide the Calva output window on a hot key but even that feels kludgy.

seancorfield00:06:17

@UGC0NEP4Y Not everyone has that window open either (the output/terminal stuff).

pinkfrog01:06:05

Yup. But somehow there shall be some room for the output. Could be inline or somewhere (tbd?).

ericdallo01:06:09

What cider does is: it shows the cider-report window when a exception happens, it's a quick emacs window where you can see something and quickly dismiss with ESC or q or use other keybindings to see more details about that report, I personally like a lot

seancorfield02:06:49

Something like that would be nice -- only for certain commands (eval whole file -- load-file) and only for errors. But the ability to trigger it via the API would also be very valuable to Joyride users, so that I could run tests the way I like (where I tap> the summary of the test results) but also pop open the output window to see the output from the tests 🙂

chucklehead21:06:53

seeing some inconsistent/unintuitive behavior with the new backspace in symbols/keywords. I first noticed it when trying to correct a typo in a dependency name and backspacing in the middle of the symbol name was just inserting/removing spaces; other positions in the map don't all behave the same way.

1
isak21:06:09

I can reproduce it like this: (here I'm pressing backspace, but a space is inserted)

isak21:06:10

I think I see the problem: this function is wrong, because it doesn't check if you have are beyond the start of a current, non-whitespace token: https://github.com/BetterThanTomorrow/calva/blob/published/src/cursor-doc/paredit.ts#L796-L804 I can submit a fix when I get home

chucklehead01:06:43

thanks, just tried the vsix from that PR and it does the expected backspace-y things now

isak01:06:40

awesome, thanks for trying it

pez06:06:29

Thanks for attending to this, @isak ! I’m at #clojured and have low bandwidth today, but will try to find some time to assist with publishing the fix.

pez06:06:38

Your fix is on it's way out now, @isak

😅 1
1
isak15:06:37

Nice, thanks!

isak15:06:29

I saw your comment - I'll will create a new issue next time.

🙏 1