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`.
pez 2021-04-23T05:33:46.148300Z

TL;DR; Try without selecting the :build alias at jack-in. Checking the deps.edn file:

{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
        org.clojure/clojurescript {:mvn/version "1.10.773"}
        reagent {:mvn/version "0.10.0" }}
 :paths ["src" "resources"]
 :aliases {:fig {:extra-deps
                  {com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
                   com.bhauman/figwheel-main {:mvn/version "0.2.11"}}
                 :extra-paths ["target" "test"]}
           :build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
           :min   {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
           :test  {:main-opts ["-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "pez.test-runner"]}}}
Calva sees that it has a :main-opts entry. So then it won’t provide it’s -m option to the command line and the nrepl server is never started.

pez 2021-04-23T07:00:21.150400Z

It is causing confusion. 😃

yuhan 2021-04-23T08:43:58.154100Z

I have a related question about jacking in - when I have added multiple folders to a workspace in vscode, is there a way to select which one calva uses to detect project files? eg. with a project structure like this:

root/
- app/
  - deps.edn
- lib/
  - deps.edn

pez 2021-04-23T09:06:08.154700Z

Calva will use the currently opened file and walk up the directory structure from there to determine where the project root is. So the answer is that if you open a file in the lib structure, that will be the one you jack in to.

👍 1
pez 2021-04-23T09:23:42.155100Z

Added this issue now: https://github.com/BetterThanTomorrow/calva/issues/1140

yuhan 2021-04-23T12:36:33.155900Z

Thanks! I never realised the jack-in/connect commands were file-based rather than workspace-based

pez 2021-04-23T13:04:04.156200Z

It’s workspace based when there is no file opened. 😃

pez 2021-04-23T05:38:52.148400Z

Was asleep, belated answer in the channel.

pez 2021-04-23T05:42:50.148600Z

I think a lot of people run into this problem. Struggling to figure out how we should handle it….

yuhan 2021-04-23T05:51:28.148800Z

I don't think it makes sense to include aliases with :main-opts in the jack-in options at all, they're meant as standalone commands to be run in the command line

yuhan 2021-04-23T05:54:41.149Z

I also found it odd that the checkbox system Calva presents doesn't allow you to specify order of aliases - although I believe that only matters for aliases with :main-opts needing to be at the very end

pez 2021-04-23T05:57:58.149200Z

The reason we include it is that some projects need to start the nrepl-server themselves.

yuhan 2021-04-23T06:02:06.149400Z

hmm, in Cider the jack-in abstraction is quite limited and just says "inject cider-nrepl deps and start a server this particular way"

yuhan 2021-04-23T06:03:29.149600Z

For anything more complicated you'd have to run the appropriate command elsewhere and connect to it - but it seems like Calva is trying to do something more here?

yuhan 2021-04-23T06:06:32.149800Z

ie. let the user select aliases, assume the ones with :main-opts specified are there to start a nrepl server (rarely the case with various build and test aliases), and then wait for a .nrepl-port to show up and connect to it

pez 2021-04-23T06:13:20.150Z

Yes, Calva tries to make jack-in applicable also for a bit more complicated cases.

yuhan 2021-04-23T06:26:28.150200Z

I wonder if this will end up causing more confusion like the above - basically whether to optimize for "easy" vs. "simple"

borkdude 2021-04-23T12:53:54.156100Z

3
🎉 3
az 2021-04-23T20:06:18.158100Z

Is it possible to autoscroll the calva.output file? I see how to autoscroll in the output window. Is that what I should be using instead of the output file directly?

pez 2021-04-23T20:08:19.159Z

Not sure what the difference between the file and the window is here, @limix?

az 2021-04-23T20:08:44.159300Z

Seems like only syntax highlighting?

pez 2021-04-23T20:09:37.160200Z

I mean, what do you mean with the file? Describe a bit what your setup is.

az 2021-04-23T20:16:09.160400Z

@pez Sorry. Here’s what I mean. When I run connect running repl I connect ok and then the output.calva-repl is opened. That file doesn’t auto scroll though. So I’ve been reading about this question and I see that if instead I use the output panel in vscode, there is an option to turn on autoscroll. I’m also trying to open a second workspace window, and have the output file window live on that second screen.

az 2021-04-23T20:16:41.160600Z

So I currently run some command, then I scroll manually in the output file window

az 2021-04-23T20:21:59.160800Z

It seems like the only issue is on the second window, the main workspace window scroll just fine

az 2021-04-23T20:26:57.161Z

@borkdude - Silly question. Are we suppose to install calva and condo separately?

borkdude 2021-04-23T20:27:23.161200Z

@limix Calva comes with LSP and LSP comes with Calva, so no :)

az 2021-04-23T20:27:38.161400Z

Got it, thank you

borkdude 2021-04-23T20:27:43.161600Z

Eventually you will get the updated clj-kondo automatically

az 2021-04-23T21:17:54.165100Z

Any tips on adding rich comment blocks in vscode. Would like to use #_ instead of comment form, but still want a way to fold or tuck away? Something like org mode. I saw a great piece that was inspiring to make comments much richer: https://www.youtube.com/watch?v=bhNvwxFV5vU

bringe 2021-04-23T22:38:45.165300Z

https://github.com/BetterThanTomorrow/calva/issues/800 There's a discussion about auto scrolling in the repl window here

bringe 2021-04-23T22:41:10.165600Z

Can you describe how you want to use #_ vs comment with an example?