calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
gabo 2021-01-15T01:12:59.030100Z

A little late but here's the PR https://github.com/BetterThanTomorrow/calva/pull/949 (I branched out from published since in was only a doc change, hope that's ok)

clyfe 2021-01-15T08:33:15.033500Z

Let | be the cursor. If I'm in this text state (foo/bar| and I move paredit.backwardSexp I end up in (|foo/bar . I'd like that to end up in (foo/|bar . Is there a movement I can use that's a mix between sexp and words?

clyfe 2021-01-15T08:43:20.033800Z

Pondering on a condition in the when bit to fall back cursorWordLeft when there's a symbol to the left (right respectively).

clyfe 2021-01-15T09:06:32.034300Z

calva:symbolToTheLeft could that become a thing?

clyfe 2021-01-15T09:10:14.034700Z

Also, I'd like to disable inline eval feedback. I find it's never useful, and otherwise annoying.

clyfe 2021-01-15T09:22:15.035500Z

Kill sexp should also add it to clipboard, because you more often move it than ditch it.

pez 2021-01-15T10:50:48.036500Z

In Calva you instead use a select command, then regular cut to clipboard.

👍 1
pez 2021-01-15T10:57:56.036600Z

It could. But it is a bit tricky to implement. Will elaborate a bit on this, but can’t right now, so for now, tricky because reasons. 😃

pez 2021-01-15T11:06:02.038Z

If we can simplify the selection commands, it would get less of a finger gymnastics thing.

pez 2021-01-15T11:09:22.039900Z

I don't think this is going to happen. We try to keep the amount of settings down to keep things simple. Curious about your workflow, now.

clyfe 2021-01-15T11:46:45.040100Z

Most of the time the data I want to look at is big enough that showing it inline is showing just it's beginning, so I look in the repl output or reveal

pez 2021-01-15T11:49:28.040300Z

Makes sense. The long results can be a bit confusing inline as well. It’s not really clear that they are truncated.

clyfe 2021-01-15T14:26:21.041Z

I have ctrl+arrows paredit movement and ctrl+shift+arrows paredit selection now. Other than that I removed a lot of Calva's defaults overriding "standard" commands.

bringe 2021-01-15T18:00:58.042Z

We used to have hovers for the inline annotations that would show the full result. Those may be brought back soon.

bringe 2021-01-15T18:04:57.042300Z

I don't find this to be true in my workflow. Though I'm unsure whether a majority of users would think so.

bringe 2021-01-15T18:06:58.042500Z

Curious what you have slurp and barf remapped to, if anything?

clyfe 2021-01-15T19:01:35.043100Z

I don't use those

Christian 2021-01-15T19:23:13.043800Z

Sometimes I jack-in but nothing happens in the output window. After a few retries it works. How am I supposed to solve this?

Christian 2021-01-16T14:32:23.070800Z

It has happened again. I opened vs code, changed something in the project.clj, jacked in, and this is the output:

Stefan T 2021-01-20T18:27:31.203100Z

This has been happening pretty regularly for me as well. The only way I’ve known to fixit was to disconnect the current REPL and jack-in again.

pez 2021-01-20T23:24:30.211400Z

Can you file it as an issue, @christiaaan? That screenshot is a good clue.

pez 2021-01-20T23:25:07.211600Z

I’m also curious about what you changed in the project file.

Stefan T 2021-01-28T22:30:57.309300Z

I ran into this again today, first three images are when it wasn’t working. I reloaded vscode to get it working again, output from a successful jack-in is the last image. The only difference I see is the socket closed message.

pez 2021-01-28T22:37:34.310400Z

I see Jack-in process kill requested. Did you kill it intentionally at any time?

Stefan T 2021-01-28T22:38:30.310600Z

No, I am doing the jack-in command using a keyboard shortcut and selecting the project type from the action menu

pez 2021-01-28T22:44:14.311Z

Thanks. Jack-in starts with killing any ongoing jacked in processes. But it is a bit strange that you get two of those prints. Then again, you get that even when it works, so it is probably not the issue at hand….

Stefan T 2021-01-28T22:50:46.311200Z

hmm yeah wish I could be of more help. Any other tips on what to look out for next time I run into this?

pez 2021-01-28T22:56:10.311400Z

You can run Calva in development mode and then when it happens you can try chase it down with breakpoints. That is how I always use Calva and it is not particularly slow or anything.

pez 2021-01-28T22:57:31.311600Z

Since it happens to you somewhat often, and never happens to me, you’ll have much higher chances at figuring this out than I have. 😃

pez 2021-01-15T19:27:49.045Z

Du you have any error messages in the dev console that seem related to Calva?

clyfe 2021-01-15T20:43:27.045300Z

Ok, maybe I'll see what I've been missing: • moved slurp/barf on: alt+shift+(<|>)+shift?<|> chords are nice they hint parenthesis movement direction • shift has the action on the left side of the cursor

pez 2021-01-15T20:48:05.045500Z

I am not following.

bringe 2021-01-15T21:32:48.046700Z

I see. I do like ctrl+alt+. and ctrl+alt+, for slurp and barf, as you suggest. I thought about these combos earlier, since as you say the last keys are also > and < on the keyboard, suggesting right and left, and also are adjacent to each other in that order.

bringe 2021-01-15T21:33:05.046900Z

And these don't overlap any vs code bindings

bringe 2021-01-15T21:34:35.047100Z

Then we could make ctrl+leftArrow and ctrl+rightArrow map to backwardSexp and forwardSexp navigation. And this maps well to default navigation in vs code.

bringe 2021-01-15T21:34:49.047300Z

I'd be behind a change in the defaults to those

pez 2021-01-15T21:45:00.047500Z

We should change the defaults for non-mac. But I’d be wary to take the scheme for slurp/barf from someone who don’t use them. 😃 Rather do something like alt+arrows on Windows. If we leave ctrl+arrows alone there it will move between “words” and we could keep ctrl+alt+arrows for form-movement for now.

pez 2021-01-15T21:50:30.047700Z

As I see it the big and general issue is that we have unwittingly hogged a very common shortcut for word-movement and used it for slurp/barf. There is a case for saying that in Clojure code forms are words, so the idea with hogging the default word-movement is worth pondering. But if we do we should also do that on Mac (`alt+enter` there) and also change the corresponding selection commands on respective platform.

bringe 2021-01-15T21:54:34.047900Z

Would you mind putting your points on this issue? https://github.com/BetterThanTomorrow/calva/issues/950

bringe 2021-01-15T21:55:01.048200Z

If any changes are made, they certainly need some discussion and consensus, I can see

Christian 2021-01-15T21:59:00.048400Z

Now it's working fine. Remind me how to get to the console again, and I will post my output here.

bringe 2021-01-15T21:59:06.048600Z

I know shortcuts are difficult to get right, in our case, with so many paredit commands that we don't want to just leave with no binding, but I'm also tired of these conversations 😂 . There's got to be some better way.

bringe 2021-01-15T21:59:34.048800Z

At least we can point people to the issue now until some solution is agreeable

pez 2021-01-15T22:00:22.049Z

I don’t think consensus is very usable in general, and about impossible in this particular space.

pez 2021-01-15T22:04:36.049200Z

There is no way you will ever get rid of these discussions, as long as Calva has default keybindings. 😃 But, certainly we should fix the downright mistakes we’ve made. And I also like the suggestion here to mimic the movement primitives. Like we have done with selection (`shift` + movement).

👍 1
pez 2021-01-15T22:33:03.049700Z

Happy to hear it is working! Hoping it will keep like that. 😃 Help menu -> Toggle Developer Tools.

pez 2021-01-15T22:51:40.051500Z

This is an Emacsism that I have chosen not to bring over to VS Code. See note in the Selecting section of the Paredit guide: https://calva.io/paredit/#selecting

bringe 2021-01-15T22:52:15.052200Z

Calva version 2.0.151 is released. 🎉 :calva: It contains a fix for the debugger on Windows. I realized while working on other changes that the debugger was hanging on Windows. I apparently broke it with recent changes that fixed the debugger's ability to step into local jar dependencies 😬 . I've now implemented a fix that keeps that ability and works on both Windows and Unix-based systems.

4
🤘 1
pez 2021-01-15T22:54:36.052600Z

The kind of bug one fixes a lot of times before it is fixed. 😃

🤞 1
☝️ 1
bringe 2021-01-15T23:01:24.053Z

Path issues and dates, forever the burdens of the developer

pez 2021-01-15T23:02:57.053300Z

A former colleague of mine said it was printers and users.

😄 1
Joe 2021-01-15T23:39:40.054300Z

I had this for a while also, but an uninstall/reinstall seems to have fixed it. It happened only when I did something in the editor prior to trying to jack in. If it happens again I'd try to get the developer tools output.

👍 2
Joe 2021-01-15T23:42:17.056Z

I'm having some trouble getting Calva's test runner working when I start the repl from the terminal (with test alias bringing in the paths) and then connect to the running repl from Calva. It works fine when I jack in from Calva itself. Is that expected behaviour?

pez 2021-01-16T09:32:43.066400Z

Calva doesn't even know the user deps.edn exists. So the difference there is probably one of not having the alias defined vs having it defined. To tell Calva about aliases it should use at Jack in, I think the menuSelections property in custom connect settings is the only way. https://calva.io/connect-sequences/

practicalli-john 2021-01-16T10:56:12.067300Z

@allaboutthatmace1789 I had a bug when using hyphenated names for aliases specifically when adding the alias via calva.replConnectSequences , but adding the same alias into the deps.edn local to the Clojure project works with hyphenated names (sorry, should have raised an issue)

👍 1
pez 2021-01-16T11:05:15.067500Z

Ah, yes, that too.

Joe 2021-01-16T16:58:23.077900Z

I tried without hyphen, i.e. called the alias just calva in .clojure/deps.edn. It's still launching with the same args:

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.6"} clj-kondo/clj-kondo {:mvn/version "2020.04.05"}}}' -A:calva -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" 

Joe 2021-01-16T17:02:25.078100Z

Should mention, I'm launching it by adding :calva to the Calva: My Clj Aliases setting

pez 2021-01-16T17:04:00.078300Z

Which args do you want it to launch with?

Joe 2021-01-16T17:08:17.078500Z

When I launch it with that alias in the project deps file, it launches with this;

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.6"} clj-kondo/clj-kondo {:mvn/version "2020.04.05"}}}' -A:calva
i.e. the same thing without -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" . I might be wrong, but it seems like those extra things are overriding the arguments in the alias - specifically the reveal middleware. I'm just not clear on why those extra things are being added

pez 2021-01-16T17:15:36.078700Z

They start the nrepl server so that Calva can provide its services. Since the alias you provide has it’s own main options, Calva does not add its default main options to the command line. There can only be one main. 😃

Joe 2021-01-16T17:20:26.078900Z

I'm sorry, I'm not following. I get that there can only be one main, what I don't get is why -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" is being added in one case (where the alias lives in .clojure/deps.edn) and not where the identical alias lives in the project deps file

pez 2021-01-16T17:22:23.079100Z

That is because Calva does not read the alias definition in the user profile, so it can’t see that there is a main option there. There used to be docs about this. Not sure when we lost them…

Joe 2021-01-16T17:24:11.079300Z

Ahhh. So if it's in the project deps, Calva can figure out that the alias has main opts, and chooses not to add it's own. But if it's in the user deps, it can't get to it, so it thinks it needs to add them.

pez 2021-01-16T17:28:26.079500Z

Yes. Well worded. If you feel up to, I’d welcome a PR to the docs so that this behaviour is not as secret as it is today.

Joe 2021-01-16T17:29:03.079700Z

Thanks, if I get a chance later today I will give it a go

bringe 2021-01-15T23:54:57.056200Z

Hi. It could be that your repl doesn't have the required dependencies. The test runner relies on cider-nrepl. When you run jack-in, you can see in the command what dependencies are added. You can copy this command and run it in another terminal, then connect, and it should work.