Fork me on GitHub
#calva
<
2020-08-01
>
pez12:08:45

@stefan.van.den.oord, version v2.0.113 should fix the issue you ran into.

Stefan12:08:04

That’s wonderful @pez ! I was still planning to submit the issue but it was quite busy the last few days, finishing up before my holiday. So I guess I won’t have to submit it anymore :) I’ll verify it soon and let you know!

pez12:08:46

Someone else submitted the issue. 😃

pez12:08:43

And @UTF99QP7V ran into it as well. I'm sorry for the messup.

🤷 1
Stefan13:08:46

@pez I just updated to 2.0.113 and indeed the issue with continuously rerunning the tests is resolved. The other issue that I mentioned is not, however, so I created a ticket for it: https://github.com/BetterThanTomorrow/calva/issues/717. It boils down to the REPL window grabbing focus when I have a compile error, which hides my editor window, which is annoying 🙂

dabrazhe13:08:51

Have something changed with repl and keyboard shortcuts in the latest Calva update? I don't see the results of evaluation any longer : (

pez13:08:26

Depends on what you mean with the latest Calva. Things have changed, alright. But you should still be able to see your evaluation results. Can you describe the failing steps a bit?

dabrazhe13:08:23

@pez Sure. When evaluating the result a new window is opening, output.repl-file, instead of the usual repl window. which is ok i guess as I've been using inline results for a while now. But occasionally the shortcut stops evaluating anything, not inline nor in the new output window. I have to re-connect the repl to revive it.

dabrazhe13:08:58

interestingly I can evaluate to the repl window when inline not longer working

dabrazhe13:08:10

i'm connecting to nrepl outside of the project, in case it matters

pez14:08:07

That doesn't matter. But very strange symptoms that. Which shortcut are you using?

dabrazhe14:08:28

evaluate top level form

dabrazhe14:08:50

I guess I found it: once I evaluate a form suspends the repl so that I need to interrupt it the output.repl evaluation won't work any longer and i need to reconnect.

pez14:08:33

You interrupt it using the Calva command for that?

dabrazhe09:08:16

Yes. It doesn’t help though as with the normal repl, I have to reconnect to nrepl every time

Stefan13:08:34

@pez I have a question about formatting. Given this form:

(cond
      (= list1 list2) :equal
      (some #{list2} parts-of-1) :superlist
      (some #{list1} parts-of-2) :sublist
      :else :unequal)
Is Calva able to format it like this?
(cond
      (= list1 list2)            :equal
      (some #{list2} parts-of-1) :superlist
      (some #{list1} parts-of-2) :sublist
      :else                      :unequal)
In other words: align the “right-hand side” in a column?

pez14:08:05

No, I don't think cljfmt has that option yet.

👍 1
tjb18:08:07

hey everyone i am using luminus and just upgraded calva. im getting the following in the new repl window

tjb18:08:07

; Hooking up nREPL sessions...
; Connected session: clj
; TIPS: You can edit the contents here. Use it as a REPL if you like.
;   Use `alt+enter` to evaluate the current top level form.
;   (`ctrl+enter` evaluates the current form.)
;   File URLs in stacktrace frames are peekable and clickable.
clj::shadow.user=> 
; Debugger initialized
; Evaluating 'afterCLJReplJackInCode'
clj::shadow.user=> 
(start)
; Syntax error compiling at (.calva/output-window/output.repl-file:14:1).
; Unable to resolve symbol: start in this context
[{:file "Compiler.java" :line 6808 :method "analyze" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6745 :method "analyze" :flags [:dup :tooling :java]}
 {:file "Compiler.java" :line 3820 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7109 :method "analyzeSeq" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6789 :method "analyze" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6745 :method "analyze" :flags [:dup :tooling :java]}
 {:file "Compiler.java" :line 6120 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 5467 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 4029 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7105 :method "analyzeSeq" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6789 :method "analyze" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7174 :method "eval" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7132 :method "eval" :flags [:dup :tooling :java]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/core.clj:3214" :fn "eval"  :method "invokeStatic" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/core.clj:3210" :fn "eval"  :method "invoke" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:91" :fn "evaluate/fn"  :method "invoke" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:437" :fn "repl/read-eval-print/fn"  :method "invoke" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:437" :fn "repl/read-eval-print"  :method "invoke" :flags [:dup :clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:458" :fn "repl/fn"  :method "invoke" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:458" :fn "repl"  :method "invokeStatic" :flags [:dup :clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:368" :fn "repl"  :method "doInvoke" :flags [:clj]}
 {:file "RestFn.java" :line 1523 :method "invoke" :flags [:java]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:84" :fn "evaluate"  :method "invokeStatic" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:56" :fn "evaluate"  :method "invoke" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:155" :fn "interruptible-eval/fn/fn"  :method "invoke" :flags [:tooling :clj]}
 {:file "AFn.java" :line 22 :method "run" :flags [:java]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/session.clj:190" :fn "session-exec/main-loop/fn"  :method "invoke" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/session.clj:189" :fn "session-exec/main-loop"  :method "invoke" :flags [:tooling :clj]}
 {:file "AFn.java" :line 22 :method "run" :flags [:java]}
 {:file "Thread.java" :line 834 :method "run" :flags [:java]}]
clj::shadow.user=> 
; Evaluation failed.

tjb18:08:07

has anyone encountered this type of output / error?

bringe18:08:07

@tjb It looks like you need to require the namespace for start before calling it

tjb18:08:10

prior to the calva changes, things would boot up with no issues

tjb18:08:23

unsure how the upgrade has changed anything? so i am a bit lost 😞

bringe18:08:13

You had that afterCLJReplJackInCode there before? I believe it does need to require a namespace before calling something in that namespace, i.e. (start)

tjb18:08:16

i will be honest i am not sure. i am fairly new to clojure and when i created the luminus template there was an option to boot both the server + client up via a dropdown

tjb18:08:34

then two repl windows would be created (prior to upgrade of calva)

tjb18:08:03

Server + Client is what i used prior

bringe18:08:35

Oh I see, yeah this should work "out of the box" - we need to look at this @pez

bringe18:08:57

Thanks for reporting @tjb

tjb19:08:26

i wish i am able to be more helpful but i am not sure what direction to debug in

bringe19:08:51

If you don't mind, can you create an issue? Lots of things to keep track of right now. Best not to let things get lost in chat

tjb19:08:03

Sure i can create on the github

bringe19:08:09

Yeah, would be great

tjb19:08:13

let me write it up and do my best to give as much detail as possible

💯 2
tjb19:08:18

should i tag you in it?

tjb19:08:28

lmao i fixed it

tjb19:08:38

"afterCLJReplJackInCode": "(user/start)",

bringe19:08:02

Was that after code something you had added yourself to begin with or calva did?

tjb19:08:52

so i generated a new lein project to be sure. the settings.json is the same with the function being called is (start)

tjb19:08:22

that is what is auto generated

bringe19:08:39

Ahhh... maybe we need to make calva require the user namespace before running the jack-in code then. Good find!

👍 1
tjb19:08:40

if i modify to (user/start) it works as the proper namespace is used

tjb19:08:00

np! glad i could help test and find stuff

tjb19:08:38

wonder if i could maybe make a PR? might take me longer than others 😛

bringe19:08:48

Please feel free!

tjb19:08:34

ill give it a look to see if i can figure it out

bringe19:08:20

It's pretty simple

tjb19:08:33

dope! ill read this and fork the repo

calva 1
bringe19:08:17

Just to point you in the right direction, see the function connectToHost in src/connector.ts

bringe19:08:50

And a tip. The session objects have an eval function on them that allows you to eval some code in that nrepl session. In that function you will see a cljSession and also you will see where the afterCLJReplJackInCode code is evaluated

bringe19:08:55

I'll leave it at that 😃

tjb19:08:45

thank you bringe!

tjb19:08:13

looking at the contribution guide i am a bit confused how to debug with Jack-in. when i go into debug mode i get No Jack-in possible

tjb19:08:32

ah i got it 🙂 need to connect to the proper repl port

👍 1