-
-
Notifications
You must be signed in to change notification settings - Fork 652
Add jack-in support for ClojureCLR #3839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add jack-in support for ClojureCLR #3839
Conversation
8766a70
to
d6449a6
Compare
d6449a6
to
3cfece4
Compare
EDIT: I decided to add an integration test to Manual test will be like:
dotnet tool install --global Clojure.Main
dotnet tool install --global Clojure.Cljr
# add dotnet tools path to PATH
export PATH="$PATH:$HOME/.dotnet/tools"
# test cljr on cli
cljr
# if tool fails to run and dotnet complains about missing version then use env variable
export DOTNET_ROLL_FORWARD="major"
|
3cfece4
to
d684cd8
Compare
d684cd8
to
0ac2db6
Compare
Ok I added an integration test but it fails with: I guess the timings could be pruned a bit but I'm not sure what is going wrong- I essentially copied over the babaska integration test due to same underlying stuff, so I'd expect it to work. Jacking in with emacs works! Also in the integration test just for clr I get a prompt labeled "Project:", once I press enter it continues. I'm not sure what is going on there I shouldn't have to interact. |
0ac2db6
to
654fafc
Compare
Updated version in GitHub workflow to what would work on Linux, forgot to update that. |
Sorry for the radio silence here - I'll take a closer look soon. |
I apologize maybe I should have left it as WIP until I figured things out better and got that test working. Slowly learning things and tooling didn't work so started there. I enjoy working on tooling. This stuff outside my background knowledge for now though. Just recently figured out how to jack-in with CIDER to a java project with just pom.xml files and built with Well I'll fix it eventually if no one else gets to it so no worries. |
Adds jack-in support for ClojureCLR.
Only changes are in the CIDER (elisp) side.
No changes to the cider-nrepl (Clojure) side are made.
Allows jacking into a ClojureCLR nREPL server clojure/clr.tools.nrepl [1] with CIDER.
clojure/clr.tools.nrepl is at present a port of babashka/babashka.nrepl [2] to ClojureCLR. Which might later change to a port of nrepl/nrepl [3] once that port to ClojureCLR is working.
So, at present jacking into ClojureCLR nREPL server this PR is set to is just like jacking into a Babashka nREPL server. Default middleware are in those repos not in cider-nrepl. W.r.t. those I see that middleware can be specified/added-to via the
:xform
parameter, but at present the jack in for Babashka doesn't support that so I didn't add it for the jack into ClojureCLR. I guess someone might want to do that with CIDER?Once the nrepl/nrepl port to ClojureCLR is working (in the subdir of clojure/clr.tools.nrepl) then better integration with CIDER can be considered, including adapting cider-nrepl to ClojureCLR. That's my understanding. I guess that's the direction things are going.
Related: #3361
Problems with this PR:
For unknown reasons eventually the sync fails and things don't seem to work.
At that point reconnecting via CIDER commands doesn't seem to work. Hadn't diagnosed what to do about this, I've come from dotnet-land wanting to use Clojure: I've never used CIDER before so I don't know what to expect. Probably user-error I guess.
EDIT: Maybe spacing in the docs might be wrong. I eyeballed the formatting. I guess linting might complain if I got that wrong.
My use-case/motivation:
For ClojureCLR I think the trend is to use inf-clojure with the socket REPL server, not Cider with an nREPL server. For Calva the vscode plugin for Clojure, looks like they've looked into using clojure/clr.tools.nrepl (nREPL) for ClojureCLR but I don't use vscode.
I'm using Doom emacs and the clojure module uses CIDER not inf-clojure and I didn't want to deal with remapping hotkeys & other configuration. So I wanted to explore using clojure/clr.tools.nrepl as-is with CIDER.
I thought to submit this PR as a basis for others to continue in the effort using & improving CIDER with ClojureCLR.
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.Thanks!
If you're just starting out to hack on CIDER you might find this section of its
manual extremely useful.