Fork me on GitHub
#calva
<
2021-04-23
>
pez05:04:46

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.

pez05:04:50

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

yuhan05:04:28

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

yuhan05:04:41

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

pez05:04:58

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

yuhan06:04:06

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

yuhan06:04:29

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?

yuhan06:04:32

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

pez06:04:20

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

yuhan06:04:28

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

pez07:04:21

It is causing confusion. 😃

yuhan08:04:58

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

pez09:04:08

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.

👍 3
yuhan12:04:33

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

pez13:04:04

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

az20:04:57

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

borkdude20:04:23

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

az20:04:38

Got it, thank you

borkdude20:04:43

Eventually you will get the updated clj-kondo automatically

az20:04:18

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?

pez20:04:19

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

az20:04:44

Seems like only syntax highlighting?

pez20:04:37

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

az20:04:09

@U0ETXRFEW 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.

az20:04:41

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

az20:04:59

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

bringe22:04:45

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

az21:04:54

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

bringe22:04:10

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

az01:04:49

@U9A1RLFNV do you think it’s best to just use comments? My thought was that it feels faster to write #_ vs opening a comment block. I guess I should maybe just go with comments.

az01:04:12

As for something like org mode though, do you have any thoughts?

bringe01:04:23

I'm not sure how you normally use comment , but in my workflow I generally have a comment block at the end of a namespace/code file, and I try out (evaluate) code there. So typing comment isn't a frequent thing for me. When I want to comment a particular thing in code I'm writing to try something else in its place, then I'll use #_.

bringe01:04:23

As far as org mode, I'm not familiar with it (or emacs/cider), and I've only briefly skipped through that video thus far so I really don't know what it's about 😄