Fork me on GitHub
#calva
<
2022-02-09
>
pez08:02:19

See me using MDD (Mistake Driven Development) at the REPL live today. In five hours. There's a Turn on reminder button there even. 😃 https://www.youtube.com/watch?v=T_wuPrHIupU

calva 7
🎥 4
🙌 3
Lukas Domagala09:02:24

MDD is the best methodology, props for choosing it!

1
Daniel Amber12:02:11

MDD 😂 - is there another kind of dev :thinking_face:

isabel13:02:42

hey everyone, I'm new to clojure and calva. I'm having trouble connecting a REPL to a project which I was able to connect a REPL to previously, so I think I messed something up in my environment, but I can't figure it out I'm trying to connect a REPL with the commands "Calva: Start or Connect to a Clojure REPL" > "Start your project with a REPL and Connect (aka Jack-in)" > project type "deps.edn" but I get this error

{:clojure.main/message
 "Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).\n-Sdeps (No such file or directory)\n",
 :clojure.main/triage
 {:clojure.error/class java.io.FileNotFoundException,
  :clojure.error/line -2,
  :clojure.error/cause "-Sdeps (No such file or directory)",
  :clojure.error/symbol java.io.FileInputStream/open0,
  :clojure.error/source "FileInputStream.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.io.FileNotFoundException,
    :message "-Sdeps (No such file or directory)",
    :at [java.io.FileInputStream open0 "FileInputStream.java" -2]}],
  :trace
  [[java.io.FileInputStream open0 "FileInputStream.java" -2]
   [java.io.FileInputStream open "FileInputStream.java" 219]
   [java.io.FileInputStream <init> "FileInputStream.java" 157]
   [java.io.FileInputStream <init> "FileInputStream.java" 112]
   [clojure.lang.Compiler loadFile "Compiler.java" 7571]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$script_opt invokeStatic "main.clj" 535]
   [clojure.main$script_opt invoke "main.clj" 530]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "-Sdeps (No such file or directory)"}}
this is what my project looks like, with a empty deps.edn https://github.com/leccese/brave-clojure-2022 any ideas?

pez13:02:49

Hi! Welcome to Clojure and Calva! I am sorry to hear you are running into problems. What operating system are you using?

isabel17:02:30

I have a windows machine but I'm running this on WSL2/Ubuntu

pez17:02:23

Can you run the command Copy jack-in command line (or something like it. And paste the result here?

isabel17:02:22

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-Sdeps (No such file or directory)

Full report at:
/tmp/clojure-4300130859912500090.edn
Jack-in process exited. Status: 1

isabel17:02:58

oops not that

isabel17:02:55

this is from "Copy jack-in"

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"

pez17:02:40

And if you run that in a terminal, what happens?

isabel17:02:43

[email protected]:~/brave-clojure-2022$ clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-Sdeps (No such file or directory)

Full report at:
/tmp/clojure-2871767856276621988.edn

pez17:02:27

Hmmm, I didn’t expect that. What could be going on… I’ll have to do some testing here. Not an expert on WSL stuff. Do you have any ideas, @U04V70XH6 ?

pez18:02:31

Maybe someone in #clojureor #clj-on-windows can make something about that last experiment you did, @imleccese

seancorfield18:02:14

@imleccese I think your clojure command is not the official CLI installation per https://clojure.org/guides/deps_and_cli -- did you install it via apt/yum instead?

seancorfield18:02:24

clojure -version should display the CLI version -- see https://clojure.org/releases/tools -- the most recent official CLI is 1.10.3.1075

isabel19:02:45

ok I just ran the linux installer from http://clojure.org and now it's working! yeah I must have had the correct installation originally but then accidentally overridden it with apt. thanks @pez and @U04V70XH6!

1
pez19:02:47

Great that you got out working. I feel a bit stupid here because I ran into this exact problem myself setting up a Linux machine a few weeks ago. I got focused on the Windows part of the message and that blocked me from connecting back. :face_with_cowboy_hat:

👍 1
seancorfield19:02:26

I've seen several folks run into a variant of No such file or directory lately with CLI options being treated as files so it rang a bell (in all cases they had installed an unofficial version of the CLI).

👍 1
orestis13:02:32

I see a "Testing" icon in the sidebar but it says "No tests have been found in this workspace yet". But when I run tests I see a test tree there. Is this the expected behaviour?

bringe03:02:24

I seem to remember something like this being mentioned before. @U0K592YDP , is there a way to get the test tree from clojure-lsp after it’s initialized and populate that testing pane with the tests before any tests are run?

Erick G. Islas Osuna04:02:55

Afaik, this was solved on the clojure-lsp side a few days ago, @UKFSJSM38 added some extra process to populate the full test tree during the clojure-lsp initialization.

👍 1
☝️ 1
Marc O'Morain10:02:49

Thanks @U02SXQU5K7X - that should indeed fix it. The issue is that LSP doesn’t send / Calva doesn’t receive data until you edit a file or run some tests.

orestis13:02:02

Hi @imleccese I forked your repo and I can jack-in with Calva just fine.

orestis13:02:19

In the terminal, I see

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
nREPL server started on port 60832 on host localhost - 

orestis13:02:30

You should have your clj files under a src/ directory though.

👍 1
orestis13:02:10

(That's the default expectation of an empty deps.edn file)

isabel17:02:12

hmm yeah so probably something's messed up with my env

orestis18:02:51

Out of curiosity, what happens if you just type “clojure” at the terminal? Or preferably “clj”? If you move your files under src you should be able to require your ch3 namespace and run the functions there.

Artem15:02:05

Hey folks! Do I understand correctly that calva bundles cljfmt compiled to JS from a fork in @pez GitHub? If so, how difficult would it be to sync the fork with the upstream? I'm seeing a discrepancy in cljfmt and Calva format where calva seems to strip trailing commas but cljfmt doesn't (the config is the same). I'm seeing some relevant commits in cljfmt that could've affected this behavior. Seems like the fork is quite a bit behind.

pez17:02:43

Hi there! Yes, you are understanding that correctly. And we should really do that work, even if the answer to that question is that it will be a bit difficult. We will have to kill some Calva features and that figure if we could soften that blow a bit for the users of those features.

Artem19:02:52

Incredibly fast turnaround on this issue, thank you for your work @pez !

pez20:02:17

Haha, thanks @UEH4D93GS. Haha, because it is super long overdue. I just happened to realize how I could do it.

pez20:02:01

(I've tried to solve this many times. But with me picking the wrong approach the issue has always won over me.)

Sam Scully21:02:28

Hi! does anyone know how to use the debugger with an app that is running locally? was hoping i could hit the endpoints and use breakpoints to step through the flow of my code

bringe03:02:33

What type of app are you trying to do this with? Is the the code you’re trying to debug Clojure? The debugger unfortunately only works with Clojure and not ClojureScript.

Sam Scully16:02:16

sorry, yes it is a clojure compojure/ring web app

bringe18:02:58

See this issue and comment about making this work with pedestal (you can probably due something similar with ring): https://github.com/BetterThanTomorrow/calva/issues/1049#issuecomment-805356322.

Sam Scully19:02:06

Thanks! Ill check this out

👍 1
agold22:02:04

A strange thing has been happening recently. I am working along without problems in a .clj file and make a small change in the code. Suddenly I see a large number of clj-kondo errors in the "Problems" pane, and the errors are not in my code but in core.clj. These are of course spurious, but the only way to get rid of them is to disconnect the REPL and restart. What am I doing wrong? It happens randomly, so I can't give repro code.

pez22:02:57

There was a similar report just some few days ago. Not sure what was the conclusion of that discussion, but at least I don't think you are doing something wrong.