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.It is causing confusion. 😃
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
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.
Added this issue now: https://github.com/BetterThanTomorrow/calva/issues/1140
Thanks! I never realised the jack-in/connect commands were file-based rather than workspace-based
It’s workspace based when there is no file opened. 😃
Was asleep, belated answer in the channel.
I think a lot of people run into this problem. Struggling to figure out how we should handle it….
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
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
The reason we include it is that some projects need to start the nrepl-server themselves.
hmm, in Cider the jack-in abstraction is quite limited and just says "inject cider-nrepl deps and start a server this particular way"
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?
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
Yes, Calva tries to make jack-in applicable also for a bit more complicated cases.
I wonder if this will end up causing more confusion like the above - basically whether to optimize for "easy" vs. "simple"
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?
Not sure what the difference between the file and the window is here, @limix?
Seems like only syntax highlighting?
I mean, what do you mean with the file? Describe a bit what your setup is.
@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.
So I currently run some command, then I scroll manually in the output file window
It seems like the only issue is on the second window, the main workspace window scroll just fine
@borkdude - Silly question. Are we suppose to install calva and condo separately?
@limix Calva comes with LSP and LSP comes with Calva, so no :)
Got it, thank you
Eventually you will get the updated clj-kondo automatically
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
https://github.com/BetterThanTomorrow/calva/issues/800 There's a discussion about auto scrolling in the repl window here
Can you describe how you want to use #_
vs comment
with an example?