BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.63k stars 213 forks source link

Automatically inject cider middleware at jack-in? #8

Closed iku000888 closed 5 years ago

iku000888 commented 6 years ago

Thanks for publishing a very promising VS Code integration!

It would be great if the middleware dependency can be automatically handled a la emacs cider.

PR in cider that accomplishes it

PEZ commented 6 years ago

Thanks! I'll have a look. Might need some help figuring it out. Will let you know.

PEZ commented 6 years ago

It seems like Calva (the extension) would need to start the REPL in order for the injection to be done. As it is now Calva merely connects to a previously started REPL.

What does your workflow look like?

iku000888 commented 6 years ago

Thanks for taking a look!

It seems like Calva (the extension) would need to start the REPL in order for the injection to be done. As it is now Calva merely connects to a previously started REPL.

Yes, cider does start the repl for me via a command called cider-jack-in

My typical work flow would be:

  1. Go to a project root with a project.clj or build.boot.
  2. Run cider-jack-in
  3. Have a clojure repl connected editor ready

Apart from starting the repl from the editor, sometimes I do connect to an already started repl (via cider-connect) which in this case would require similar manual setup.

PEZ commented 6 years ago

Thanks. I probably should support that workflow. And, while at it, do the dependency auto-inject. I don't really like that such a big part of the README is about dependencies. 🤠

No ETA though, I need some good focus hours to get it rightly implemented.

bpringe commented 6 years ago

I second this. I think getting the extension to start the repl automatically and connect to it is key for getting more beginners into Clojure (via this extension at least). I previously used a less feature rich extension for Clojure in VS Code that automatically started the repl and connected to it. This helped me quickly get into Clojure when I was just starting out. It would have taken me some time to figure this out otherwise.

I think I actually tried Calva in the past, but couldn't easily figure out how to connect the integrated repl (I had a very limited understanding of the repl and leiningen), so I abandoned Calva and went back to the other extension. Later I got tired of the lack of features and came back to Calva with my new knowledge and got it working. I just wanted to illustrate my perspective as a beginner as it may be representative of the average Clojure beginner.

slipset commented 6 years ago

I guess that this would let users connect to repls being exposed by boot and clj as well?

PEZ commented 5 years ago

This feature is being worked on right now. Mostly by @mseddon, with me as a tester. Hopefully not to far away from release!

And, we will probably have boot and clj somewhat covered, @slipset. Sorry for leaving that question hanging for so long!

PEZ commented 5 years ago

I welcome anyone interested in this feature to join the #calva-dev channel on Clojurians Slack. There you'll find preview builds of Calva where some of this is working and that we need feedback on to get the feature right.

As for CLJ and Boot. We will definitely try to support CLJ, but Boot will probably have to wait beyond version 1 of this feature. We know too little about it, and it takes quite a lot of time to figure out how to analyze the different project definitions, so Leiningen + CLJ + shadow-cljs will be our main targets for now.

KingMob commented 5 years ago

I was looking over the issues and saw this. Isn't it done? Calva does this currently.

PEZ commented 5 years ago

Thanks. This should indeed be closed.

Let me know what else funny stuff you find in the issues-box. :smile: