calva

neumann 2025-10-04T20:23:52.232539Z

I'm trying to figure out how to start a Clojure REPL for a completely blank project. For context, I'm putting together a Clojure workshop, and I don't want to introduce the deps.edn file up front. I'd like to have the attendees do some interactive REPL-ing first. What I did: 1. I opened a new folder with nothing in it 2. I ran the command: "Start a Project REPL and Connect" It only gives me options to run a REPL using Babashka, nbb, and joyride. Is there a way I can start a clojure REPL? I added a blank deps.edn file, and then I got the options involving deps.edn. The clojure command line doesn't require a deps.edn file to be present. Would it be possible to put the deps.edn options in the menu even if there isn't a deps.edn file?

👌 1
neumann 2025-10-04T20:25:27.749549Z

As for the workshop, I can have them create a "mini" project, which will make the deps.edn file for them. Then I'll just ignore it until later.

neumann 2025-10-04T20:27:25.513159Z

I'm mainly just wondering if there is a reason to not make the deps.edn REPL options available with no deps.edn file. Or maybe even have it called a "Clojure CLI" REPL or something like that.

borkdude 2025-10-04T20:29:56.014719Z

@neumann If I recall correctly there is "Start REPL not in project" in Calva

borkdude 2025-10-04T20:31:46.600859Z

oh no sorry, that was "Connect to a running REPL not in project". I only remembered "not in project", sorry

neumann 2025-10-04T20:34:34.189909Z

Ah yes. I was just about to paste a screenshot.

pez 2025-10-05T07:25:52.571679Z

There’s no reason not to include a clojure cli option, afaics. The omission is legacy from back when project files were the only way Calva could know what to include in that menu. But since very long we’ve been adding Babashka as a config-less option and we could easily extend that list.

borkdude 2025-10-05T07:36:11.697939Z

One thing that does come to my mind is that the linter and LSP won’t work since there isn’t a project root to detect maybe?

pez 2025-10-05T08:12:20.513779Z

Depends on what clojure-lsp defaults to.

borkdude 2025-10-05T08:13:01.106519Z

I guess you could try it out and see?

pez 2025-10-05T09:25:13.252859Z

It’s a bit opaque to me what happens, but if I simulate it by starting a Babashka repl, (clojure-lsp doesn’t know what kind of REPL Calva is connected to) it seems clojure-lsp defaults to the same source path as clojure would do. But it doesn’t try to start clojure to resolve this and clojure core isn’t on the classpath, afaict. So before anything is evaluated in the repl is started some navigation doesn’t work, but otherwise things work fine. I think generally things will work mostly fine, especially since Calva uses a combo of static and dynamic ways to provide its features, the user will mostly not notice if clojure-lsp isn’t serving in all cases it would serve if it had used clojure to set things up.