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`.
sashton 2021-03-10T15:12:20.231900Z

Following along the “Getting Started” REPL, in hello_repl.clj, it indicates that the user can use Go to Definition on Java methods “if you have Java sources installed”. What is involved in installing Java sources in this context? Is it referring to an SDK installation? If so, how is that discovered by vscode? Or is there a specific extension needed to support Java sources?

bringe 2021-03-10T17:01:07.232100Z

I had the same question in the past. See the answer here: https://github.com/clojure-emacs/orchard/issues/103#issuecomment-764936527

bringe 2021-03-10T17:01:30.232400Z

We probably should provide info on this in docs or the guide

pez 2021-03-10T18:36:36.232700Z

Happy to hear you are trying out the Getting Started REPL! I’m super curious about how/if it works for you as a means to get started. Ar you a beginner with Calva and/or Clojure, or are you mainly checking it out?

sashton 2021-03-10T20:06:50.234300Z

Checking it out. Coming from cursive.

leoiacovini 2021-03-10T20:08:42.235700Z

Hey folks 👋 I have been trying out Calva during the last weeks, and it has being a very capable a great tool so far, thanks for the effort 🙂 However, one problem that myself and some colleagues have been facing is that Calva fails to load some namespace dependencies correctly, so it ends up throwing exception like:

; Syntax error (FileNotFoundException) compiling at (test/messaggero/db/datomic/notifications_test.clj:1:1).
; Could not locate messaggero/aux__init.class, messaggero/aux.clj or messaggero/aux.cljc on classpath.
; Evaluation of file notifications_test.clj failed: class clojure.lang.Compiler$CompilerException
Usually I need to manually trace back the dependency tree and load each file individually until I am able to load the ns I want to work in. Is this something that has already being tracked?

👀 1
seancorfield 2021-03-10T20:16:12.236100Z

@leoiacovini Are you on Windows?

leoiacovini 2021-03-10T20:17:17.236300Z

Nope, MacOS here

seancorfield 2021-03-10T20:26:03.236500Z

Just checking, since aux and a few other filenames behave strangely on Windows (legacy references to CON, AUX, PRN ports etc).

sashton 2021-03-10T20:29:11.236800Z

I guess I mean, I’m checking out Calva

pez 2021-03-10T20:42:13.237100Z

Hello, and thanks for recognizing that this is an effort. We try, we try. 😍 I am not completely sure I understand the problem, or rather how it is Calva related. Calva only loads what you tell it to load. I know that Cursive has some pretty extensive load mechanism that you can use to load more eagerly (or whatever the right word is). I haven’t wrapped my head around what that is really, but maybe that is what you are missing? Meanwhile, if you know what files that if loaded will load what you need for your session, I’m thinking, maybe you can use the custom connect sequence so that when you connect the project, a start command will fire that loads the necessary files. (Again, speaking without having really understood, so apologies if it doesn’t make sense.)

pez 2021-03-10T20:43:29.237300Z

I see, I hope you’ll like it. Even if it is a bit more spartan than Cursive. 😃

alidlorenzo 2021-03-10T21:17:27.238400Z

is there a way to configure a command calva calls when disconnecting? i start the repl server separately and sometimes disconnect to clean the build, so trying to configure a sort of cleanup hook when disconnecting

pez 2021-03-10T21:21:29.239900Z

Not, currently. But sounds like it would fit in a custom connect sequence. Please file an issue. And of course, please submit a PR too. 😃 We are here to help guiding anyone that wants to hack on Calva.

✔️ 1
leoiacovini 2021-03-10T21:30:38.240100Z

Thanks! What I meant is that if I have a namespace in my project that includes some other required ns (using the regular (:require [...]) syntax, ie: If I load this using the Calva: Load current file and dependencies command

(ns my-ns
  (:require [utilities :as utils])) 

(utils/say-hello! "")
The required namespaces (in this case utilities) is not being properly loaded when I load the my-ns namespace, thus throwing the exception I pasted above. Sometimes is not the direct required namespace, but instead an indirect dependency that it has. And it also does not happen constantly, but it’s a frequent thing that I have been experiencing, what I usually need to do, is to close the REPL and open a fresh one again Not sure if I made myself completely clear 😅

leoiacovini 2021-03-10T21:31:37.240300Z

Haha, makes sense. But it happens with a lot of different namespaces, not specially with this one. Seems more something related to some state that is messed up. Because re-starting the repl and loading again, usually works

pez 2021-03-10T21:35:22.240500Z

Yeah, you are making yourself clear. 😃 Is anyone in your team using Emacs/CIDER? I’d be curious if there is the same problem there. Also if you do (require … :reload-all), does that help any?

pez 2021-03-10T21:36:58.240800Z

In any case, it sounds like you should file an issue. Not sure I understand it well enough, yet, to be able to fix it, but with issues things get visible and sometimes someone throws the needed light on things.

leoiacovini 2021-03-10T21:41:25.241Z

I have checked with some folks who uses Emacs/CIDER (@ericdallo for example), and they haven’t faced this kind of problem. I just found this issue: https://github.com/BetterThanTomorrow/calva/issues/907 I think it may be related, I will try to do some isolated testing, and see if I can bring a more accurate report 🙂 Thanks anyway for the help

👍 2
pez 2021-03-10T21:53:08.241500Z

That does seem related. I have not quite experienced that problem myself, it was just something I became aware of. Now asked here about what the fix is from the REPL point of view. https://clojurians.slack.com/archives/C03S1KBA2/p1615413134450300

bringe 2021-03-10T22:08:03.244600Z

Calva version 2.0.179 is released. It just includes an implementation change that helps us move forward with using ClojureScript for more of Calva's implementation. Specifically, we use CLJS for ephemeral state now instead of TS + Immutable.js. Everything should work the same as before, and has in my testing, but if you notice anything strange please report it. :simple_smile:

teodorlu 2021-03-10T22:12:44.245900Z

A colleague of mine is getting started with Clojure. He asked for editor recommendations. I said Cursive, since it's worked well for me previously. He wasn't too happy with "going back to Intellij". He decided to try Calva, looking for something more lightweight. Outcome? He's happy with what he's got now. The "Getting Started" REPL was especially impressive. Great work!

❤️ 4
bringe 2021-03-10T22:14:45.247600Z

Yes, @pez, I second the above. Great work on that!

❤️ 1
Jordan Gibson 2021-03-10T22:16:18.249100Z

That was my experience as well. I'm taking a college course that uses Clojure and they recommended Sublime Text which I didn't like at all. I've used Intellij before but Cursive felt really heavy and I didn't have the patience to learn Emacs and Clojure at the same time. Calva feels perfect

❤️ 2
bringe 2021-03-10T22:19:12.249300Z

That's awesome. And it's also awesome that a college course uses Clojure. May I ask what college or where?

Jordan Gibson 2021-03-10T22:22:07.249500Z

It's the Programming Languages and Translation course at Auburn University. I'm in their online CS bachelor's program

Jordan Gibson 2021-03-10T22:22:32.249700Z

We're covering Clojure and Smalltalk as examples of functional and object oriented languages

bringe 2021-03-10T22:23:21.249900Z

Oh that's cool

sashton 2021-03-10T22:31:53.250100Z

Back to the original question... I've got Java src.zip in my jdk directory, but is something supposed to find it there to get Go To Definition to work?

bringe 2021-03-10T22:34:30.250400Z

cider-nrepl should find it, but they actually may have an issue with this right now, see the issue linked above. I've never actually tried to make this work.

pez 2021-03-10T22:34:34.250600Z

Thanks for letting us know! I especially need to hear things like this about the Getting Started REPL, because I have spent A LOT of hours on it. I do intend to complete the Clojure guide, but am glad I released the feature even with the guide unfinished. 😃

👍 1
pez 2021-03-10T22:37:07.251Z

At the Royal Institute for Technology (the main engineer university in Stockholm) they have a course about building big systems, and it is based on Clojure. Thomas Ekholm, who’s managing the course, refused to continue with it if it was to remain a Java based course. 😃

💥 1
pez 2021-03-10T22:37:58.251900Z

While you are all this happy with Calva, please consider filing a review. Link in the topic of this channel. ❤️

👍 2
pez 2021-03-10T22:40:00.252100Z

I just command-click things like Math/abs and it just works. MacOS. Installing Java using sdk-man (no idea if that makes a difference, but anyway).

bringe 2021-03-10T22:41:35.252300Z

Maybe a different JDK version would help in the meantime, but I'm not sure. And if using clojure cli, try lein, and vice versa.

Jordan Gibson 2021-03-10T22:45:56.252700Z

I submitted one, thanks for making it easy to get started with Clojure

❤️ 1
pez 2021-03-10T22:50:38.252900Z

Awesome. You are most welcome, sir!

sashton 2021-03-10T23:10:30.253300Z

Yeah, I updated to jdk11 and also installed the sources (I'm on Linux). It works now, thanks!

pez 2021-03-10T23:17:13.253500Z

Awesome. It is a pretty nice thing to have working.

pez 2021-03-10T23:23:25.258100Z

You know what, dear Calva-friends? I need help testing a thing again. This time someone reminded me about an issue with how Paredit-selecting things first forwards then backwards (or vice versa) behaves a bit surprisingly. And it made me realize that I now understand how to fix it, so I did. Check the issue for context and install the VSIX if you feel like helping me test it. Thanks in advance! ❤️https://github.com/BetterThanTomorrow/calva/pull/1066 • More context in https://github.com/BetterThanTomorrow/calva/issues/1062https://12044-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.180-1062-select-back-fwd-df06c31b.vsix.

bringe 2021-03-10T23:56:15.258500Z

Sweet!