Fork me on GitHub
Thomas Tay00:04:56

Cross posting this here. I'm working on a project that needs to include a single Java file. Any advice on how to do this easily from Calva? I'll be working both the Java and clojure together, so ideally some sort of hotkey to recompile the Java file and reload the class would be helpful


Are you using leiningen or clojure cli?

Thomas Tay01:04:38

Clojure CLI. actually I just managed to get it to work, by manually invoking javac and putting it into a classes/ folder


exactly, with clojure cli there is no easy way AFAIK to achieve that automatically, you can wrap that in a script


on clojure-lsp, we have a class that we don't need to maintain, so we extracted it to another lib that we use on dependencies


I was thinking other day in create a deps.edn lib that would handle those cases and compile the java classes and include on classpath

Thomas Tay01:04:54

Hmm but now I have to reload the repl every time I change the Java file. Quick google doesn't seem like there's a way around it

Thomas Tay01:04:22

Eric that might be useful


yes, I don't think there's a easy way to make the java file changes available on repl, maybe you can ask for help on #nrepl

👍 4

Maybe @U04V70XH6 has an idea? He’s a master of dynamic things. 😃


Someone — I can’t remember who — wrote a Clojure library to do dynamic recompilation of Java.

👀 6

Ah, I was thinking of this but it only documents how to work with Leiningen and Boot. I bet you could make it run with the CLI and deps.edn if you wanted to spend some time on it.

metal 3
Thomas Tay18:04:45

Thanks Sean, I'll take a look this weekend, looks promising. Zach tellman's stuff is always the best


I get unresolved symbol error from clj-condo linter when I use r/with-let as a sample I define values here but it says Unresolved symbol:values

(defn login []
    [values (r/atom {:domain (.get ...


@UJ35GLZU7 probably r/with-let is a macro and should be configured as :lint-as or hooks, check clj-kondo documentation about macros:


thank you for guiding me there, now I added like: {:linters {:lint-as {r/with-let clojure.core/let}}} but still same


it should be something like:

{:linters {:lint-as {full-r-namespace/with-let clojure.core/let}}}


I didn't think about it 😅



😉 4
Aleksander Rendtslev12:04:22

Hi, Is there a way to run custom npm scripts when doing jack-in? I’m running a postcss watcher for tailwind-jit. It works if I start shadow-cljs in a separate terminal and then connect. But it seems like i’m missing a few features. (I’m unsure about this though. But automatically creating namespaces when I create new files isn’t working). It is in my other project where I do a normal jack in


Hello, there is currently no hook in jack-in for running custom scripts. Might be something we should consider. There are some things you could investigate around it that I come to think of, though. • With there is an afterCLJReplJackInCode option. Maybe you can start the script using • shadow-cljs might have some hook for this • Tell us how you do it from the separate terminal and maybe we can come up with more ideas. 😃 Regarding functionality. As long as you start shadow with the dependencies that Calva jack-in starts it, there should be no difference in Calva functionality. And the specific feature with creating namespaces is not even using the REPL connection, so there must be something else going on/wrong. If you are using latest Calva, I think this is handled by clojure-lsp, but I’m not sure, Calva is developing faster than I can keep up, 😂


That's true, latest uses clojure-lsp for auto namespace creation.


Hi there, my company are using a dual Calva+Emacs workflow and picked zprint as our formatter. I am not a Calva power user but I was wondering if there is any suggestion on how to make so that Calva uses zprint as default formatter.


This might work, @richiardiandrea. The jury is still out. Calva could definitely be made to use zprint as a formatter. It is a matter of putting in the work.


oh cool we'll try and report back...wonder if it can work with the binary as well, we'll fiddle


thanks @U0ETXRFEW for the prompt reply


np. Should work with the binary as well. The experience will not be as smooth as Calva’s built in, I think. Feel invited to file a request on Calva to support zprint if you find that this external formatter way doesn’t cut it.


ok thanks yeah will do that