Fork me on GitHub
#calva
<
2020-08-04
>
Maksim Glebov06:08:02

Hi! Just want to give a feedback about new peek-to-result feature. First of all, thanks for putting your effort on this. I see some people likes it, which is great! For me it turned out to be a bit difficult to use: - When evaluating the form with Alt + Enter and having cursor not on a parenthesis, the peek widget displays the current function definition instead of the output result. The result is still accessible, but it takes two extra clicks to reach it. - Closing the peek with Esc does not work if my cursor is inside the code area of the peek (i.e. for scrolling). I think this is a default VSCode behaviour. For now I ended up with just opening the output window with Ctrl + Alt + C O when I want to see full result. It opens in a new editor group and my file is still visible. After some exploration I usually close it again. This workflow is pretty fast (faster than peeking with extra clicks) and can be even faster if I'd be able to close the output window with key shortcut (default VSCode shortcut Ctrl + W is overwritten with Paredit selection in Calva).

Maksim Glebov07:08:49

For me the only inconvenience of working with closed output window is that I can't see the effect of file loading (`Ctrl + Alt + C Enter`). I was thinking about some kind of label in a status bar showing the current namespace and error status (green/red)...

pez07:08:04

Thanks. Yes, peek at definition is not really meant for this use, so it comes with some inconveniences. The arrow keys walk and expand the different definition locations, so you don't need to click with the mouse (at least).

bringe16:08:23

@glebovmaksim We had some conversation about load file error indication here: https://github.com/BetterThanTomorrow/calva/issues/717

pez09:08:30

New old-repl-window-less vsix https://7173-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.116-711-remove-old-repl-window-5a088397.vsix, it restores evaluate to comment, reported by @elizavetaskull, and also makes the result definition peek be alone when the cursor hasn't moved since the evaluation was run. That means that for a key sequence of alt+enter, alt+f12 , there should only be the results definition there, so no need to navigate. And hover definition on symbols should still be showing what they used to show. Please give it a try, @glebovmaksim and @slack1304 (and everyone, of course).

9
Cris B11:08:41

Pasting seems to be broken for me - the pasted text flashes briefly then disappears.

pez11:08:50

Generally pasting into an editor? There is a change to the pasting in there, actually. It is a little hard to imagine it having that effect, but somehow it must...

Maksim Glebov12:08:27

I can confirm that it's broken.

Maksim Glebov12:08:03

Peeking has become more convenient from a user perspective. Not sure if that little trick with cursor looks good in the code though...

pez16:08:53

Oh, it fits in there pretty cleanly. We get a position to provide definitions for and just need to check that it's not from where an active results annotation was activated. Like so:

async provideDefinition(document, position: vscode.Position, token) {
    const evalPos = annotations.getEvaluationPosition(position);
    const posIsEvalPos = evalPos && position.isEqual(evalPos);
    if (util.getConnectedState() && !posIsEvalPos) {

Maksim Glebov16:08:35

Ok, good to know :) Just wondering if we were asking for something that can't be done in a nice way. Thank you!

pez16:08:48

We're just abusing the definition provider a tiny bit more. Haha.

😆 3
pez16:08:07

New old-repl-window-less vsix: https://7143-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.116-711-remove-old-repl-window-49cdf856.vsix • Paste now works again • *1. *2, etcetera works as expected in the editors (it never has with Calva, which became exposed with the new output/repl window)

pez16:08:33

Oh, this should have been in the channel....

dabrazhe09:08:09

I am wondering what are the benefits of the output window over the old Repl window? Or is this just for ease of maintenance?

dabrazhe09:08:22

excellent, a good long read that wont go away, like it does on Slack : )

Cris B09:08:34

Totally :spock-hand::skin-tone-2:

maxp10:08:25

How to eval the whole file in editor?

Cris B10:08:52

@maxp the command is 'calva - load current file & dependencies', bound by default to ctrl-alt-C Enter

metal 3
Cris B10:08:33

I'm trying to get Calva working with REBL. I haven't read up yet on how the pieces (nrepl/middleware/editor) fit together so am flying a bit blind. I have a deps.edn alias that starts an nrepl, REBL, and middleware (https://github.com/RickMoynihan/nrebl.middleware) to connect these up. Then I connect to that running nrepl from Calva (I'll leave automating with a Calva connection sequence 'till everything else works). This works partially - I can evaluate forms in Calva, and inspect data in REBL. But Calva's documentation and go to definition commands don't work, so presumably the middleware and/or REBL are getting in the way. Is this to be expected, or should I be able to get both data browsing & Calva's commands all working simultaneously?

bringe16:08:57

I've not tried this, but have you read this? https://calva.io/rebl/

bringe16:08:17

Also if goto def is not working, maybe you didn't load cider-nrepl as a dep in your repl

Cris B04:08:25

Yep that's the guide I used to set it up. I don't know where cider-nrepl fits in (there's no mention of it in the Calva/REBL guide). I think I'll have to postpone this 'till I've read up on how the parts fit together so I can troubleshoot.

Cris B05:08:46

I got it working by adding cider.nrepl/cider-middleware to the alias. So thanks for the pointer.

👍 3
pez16:08:40

New old-repl-window-less vsix: https://7143-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.116-711-remove-old-repl-window-49cdf856.vsix • Paste now works again • *1. *2, etcetera works as expected in the editors (it never has with Calva, which became exposed with the new output/repl window)

calva 6
bringe17:08:20

With this vsix, I'm still getting the #namespace[namespace] result with *1 :thinking_face:

bringe17:08:18

I eval'ed these two lines one after the other

pez17:08:32

I might have liked an old vsix. With only the first fix. 😀

pez17:08:49

I'm afk. But if you trigger a new build, then we should get the *1, etc fix.

bringe17:08:38

Latest build does not seem to be working either. Maybe you need to re-push?

bringe17:08:55

I built again too, but same commit hash

bringe17:08:57

¯\(ツ)

pez19:08:04

I did a force push. Might be what is messing it up.

bringe19:08:06

Also having a weird issue where the current namespace keeps reverting back to user in the output window

bringe19:08:00

had to revert back to .115