Fork me on GitHub
#calva
<
2021-01-15
>
clyfe08:01:15

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?

clyfe08:01:20

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

clyfe09:01:32

calva:symbolToTheLeft could that become a thing?

pez10:01:56

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. 😃

clyfe09:01:14

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

pez11:01:22

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.

clyfe11:01:45

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

pez11:01:28

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

bringe18:01:58

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

clyfe09:01:15

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

bringe18:01:57

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

pez22:01:40

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

pez10:01:48

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

👍 3
pez11:01:02

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

clyfe14:01:21

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.

bringe18:01:58

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

clyfe19:01:35

I don't use those

clyfe20:01:27

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

pez20:01:05

I am not following.

bringe21:01:48

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.

bringe21:01:05

And these don't overlap any vs code bindings

bringe21:01:35

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.

bringe21:01:49

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

pez21:01:00

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.

pez21:01:30

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.

bringe21:01:34

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

bringe21:01:01

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

bringe21:01:06

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.

bringe21:01:34

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

pez22:01:22

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

pez22:01:36

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).

👍 3
Christian19:01:13

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

pez19:01:49

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

Christian21:01:00

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

pez22:01:03

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

Joe23:01:40

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.

👍 6
Christian14:01:23

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

Stefan T18:01:31

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.

pez23:01:30

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

pez23:01:07

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

Stefan T22:01:57

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.

pez22:01:34

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

Stefan T22:01:30

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

pez22:01:14

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 T22:01:46

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

pez22:01:10

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.

pez22:01:31

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. 😃

bringe22:01:15

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.

metal 3
calva 12
pez22:01:36

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

☝️ 3
🤞 3
bringe23:01:24

Path issues and dates, forever the burdens of the developer

pez23:01:57

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

😄 3
Joe23:01:17

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?

bringe23:01:57

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.

Joe00:01:13

Thank you! Tangentially related: If I have an alias :calva in my project deps.edn, and I jack in using that, the REPL is launched with

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
but if I have an identical alias :calva-user in my user deps.edn, and jack in using that, the REPL is launched with
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-user -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
I think that the things after calva-user there are causing it to overwrite some of the main-opts in the alias, is that right? This is the alias in full
{:extra-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"}
                       vlaaad/reveal {:mvn/version "1.2.185"}}
          :jvm-opts   ["-Dvlaaad.reveal.prefs={:font-size,48}"]
          :main-opts ["-m" "nrepl.cmdline"
                      "--middleware" "[vlaaad.reveal.nrepl/middleware,cider.nrepl/cider-middleware]"]}

bringe00:01:35

Hmm I'm not really sure. Can you send your full deps.edn?

Joe00:01:23

this is ~/.clojure/deps.edn

bringe02:01:16

So you're saying when you name that calva-user alias just calva the jack-in command is different? I feel I remember something to do with hyphenated alias names. I'm going to defer to @U0ETXRFEW on this. Maybe he has some more info.

Joe02:01:59

I will definitely check the name thing, but the distinction i meant is where the alias is defined. The one I called calva is defined in the deps.edn of the project, and the one I called calva-user is defined in the user deps.edn file. What I’m not sure about is why the REPL launch string is any different, I was surprised Calva even realized there was a difference.

pez09:01:43

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-john10:01:12

@U0105JJK1L3 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)

👍 3
pez11:01:15

Ah, yes, that too.

Joe16:01:23

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]" 

Joe17:01:25

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

pez17:01:00

Which args do you want it to launch with?

Joe17:01:17

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

pez17:01:36

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. 😃

Joe17:01:26

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

pez17:01:23

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…

Joe17:01:11

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.

pez17:01:26

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.

Joe17:01:03

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