Fork me on GitHub

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?


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


calva:symbolToTheLeft could that become a thing?


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


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


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.


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


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


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


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


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


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:


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

👍 1

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


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


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


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


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

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.


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


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.


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


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?


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.


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


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?


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.


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


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


this is ~/.clojure/deps.edn


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.


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.


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.


@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

Ah, yes, that too.


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


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


Which args do you want it to launch with?


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


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


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


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…


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.


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.


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