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.

👍 1
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.

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

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)

👍 1
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