Skip to content
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

Support the most common interactions without the need for extra middleware #2611

bbatsov opened this Issue Mar 23, 2019 · 3 comments


None yet
2 participants
Copy link

bbatsov commented Mar 23, 2019

Is your feature request related to a problem? Please describe.

Some people are always frustrated that CIDER requires some additional setup (namely the need for cider-nrepl) and would prefer if they had a limited subset of functionality, but everything worked out of the box.

I resisted this idea in the past, but now I've come to realize that my ideological purity is not necessarily the right thing. There are also some other practical benefits from a more flexible approach - namely you could connect to any random nREPL server and get a bit more than just basic evaluation.

Describe the solution you'd like

We'd simply put some fallback for cider-nrepl powered commands (when possible) that's simple evaluation of Clojure code. Ideally we'd have to come up with code that's bundled with Clojure but we can also add some checks for common libraries on the classpath (e.g. orchard, compliment, etc).

I think the most important things we should aim to support with this eval fallback are:

  • completion
  • jump to definition
  • doc
  • eldoc
  • running tests

Note: all such evaluations should happen in the tooling session, so their results won't mess up *1, *2, etc.

Describe alternatives you've considered

There are no real alternatives to this (at least I can't think of any), and the eval approach will become even more feasible when we implement sideloading in nREPL.

Additional context

CIDER used to have such a fallback mechanism prior to version 0.8, so we can restore a bit of functionality from there. I know @arichiardi will be happy about this direction. :-)


This comment has been minimized.

Copy link
Member Author

bbatsov commented Mar 23, 2019

My bad. They were removed in 0.7, but here you can see how things used to look before -

(defun cider--jump-to-def-eval-fn (var)

To avoid having to load code in such a horrible manner I'm thinking that we can just ship a few .clj files with CIDER and load those on startup or something along those lines. Simple code can be embedded directly though.


This comment has been minimized.

Copy link

arichiardi commented Mar 23, 2019

Oh oh so so happy 😄

I guess you also mean things like apropos, dir, ... ?


This comment has been minimized.

Copy link
Member Author

bbatsov commented Mar 24, 2019

Yeah, potentially. We'll see what makes sense and what doesn't. I don't want to go overboard with this and for some things the UI will likely be different (e.g. just dumping stuff in the REPL).

bbatsov added a commit that referenced this issue Mar 26, 2019

bbatsov added a commit that referenced this issue Apr 18, 2019

[#2611] Add eval-based var info lookup
Now find definition and documentation lookup (mostly) work even
without the presence of cider-nrepl.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.