Fork me on GitHub
#calva
<
2021-03-10
>
sashton15:03:20

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?

bringe17:03:30

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

pez18:03:36

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?

sashton20:03:50

Checking it out. Coming from cursive.

sashton20:03:11

I guess I mean, I’m checking out Calva

pez20:03:29

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

sashton22:03:53

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?

bringe22:03:30

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.

pez22:03:00

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).

bringe22:03:35

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.

sashton23:03:30

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

pez23:03:13

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

leoiacovini20:03:42

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
pez20:03:13

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.)

leoiacovini21:03:38

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 😅

pez21:03:22

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?

pez21:03:58

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.

leoiacovini21:03:25

I have checked with some folks who uses Emacs/CIDER (@UKFSJSM38 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
pez21:03:08

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

leoiacovini20:03:17

Nope, MacOS here

seancorfield20:03:03

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

leoiacovini21:03:37

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

alidlorenzo21:03:27

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

pez21:03:29

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
bringe22:03:03

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

teodorlu22:03:44

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
pez22:03:34

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
bringe22:03:45

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

❤️ 1
Jordan Gibson22:03:18

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
bringe22:03:12

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

Jordan Gibson22:03:07

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

Jordan Gibson22:03:32

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

bringe22:03:21

Oh that's cool

pez22:03:07

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
pez22:03:58

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

👍 2
Jordan Gibson22:03:56

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

❤️ 1
pez22:03:38

Awesome. You are most welcome, sir!

pez23:03:25

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.

pez07:03:18

I’ve updated this PR now. Grab new VSIX from CircleCI if you want something a bit saner than that ^ one.