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

Refactor-nrepl middleware not enabled because Cider cannot find project #131

Closed
dmg46664 opened this issue Oct 25, 2019 · 10 comments
Closed
Assignees
Labels
area:cider enhancement New feature or request

Comments

@dmg46664
Copy link

Desired Behavior

I've raised this as a feature request on the assumption that it isn't present.
I'm new to all this so it may be that I don't understand precisely what I'm doing.

The desired behaviour is for the following to go away.

WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
user> 

Context

I have the cider-repl and handler connected

implementation 'cider:cider-nrepl:0.23.0-SNAPSHOT'

...

(defn nrepl-handler []
  (require 'cider.nrepl)
  (ns-resolve 'cider.nrepl 'cider-nrepl-handler))

(defn start-server [port]
  (nrepl-server/start-server :port port :handler (nrepl-handler)))

I connect fine but get the above mentioned warning. I presume that the refactoring tooling is trying to parse something locally about the project but cannot see it because of some mismatched expectation.

@dmg46664
Copy link
Author

It's entirely possible that Cider has to support clojurephant, which seems a pity if that's the way it works.

@dmg46664
Copy link
Author

@dmg46664
Copy link
Author

If everything above does make sense, then I think clojurephant should have a not-supported features section on the main page, to let Emacs users know what they will sacrifice if they choose this build tool.

Presumably this also means hot-loading dependencies in the REPL is not supported https://practicalli.github.io/spacemacs/refactor/clj-refactor/managing-library-dependencies.html

@ajoberstar
Copy link
Member

Do you have a dependency on refactor-nrepl?

@dmg46664
Copy link
Author

@ajoberstar Not in my project, but enabled in Emacs I believe . If I understand your question correctly which I might not given I don't understand the difference between clj-refactor and refactor-nrepl.

I have done the following:
http://develop.spacemacs.org/layers/+lang/clojure/README.html#enabling-sayid-or-clj-refactor

Thanks for replying.

@dmg46664
Copy link
Author

@ajoberstar - Ahh! Thanks for highlighting this to me!

On the other hand if a standalone REPL or an embedded nREPL server is used you will need to manually add this dependency (see below).

from https://github.com/clojure-emacs/clj-refactor.el

However, even though I've added the dependency to refactor-nrepl, I believe it needs to be setup as middleware some how? I'm not sure how to do this.

I've sought help here: clojure-emacs/cider#2511 (comment)

@ajoberstar
Copy link
Member

Are you following the instructions in the FAQ? And starting the repl from the clojureRepl task? Not sure if this will make a difference.

@ska2342
Copy link

ska2342 commented Apr 20, 2020

Cider has support for Gradle. See e.g. https://github.com/clojure-emacs/cider/blob/master/cider.el#L199
Doesn't work with the Gradle wrapper, though. I'd think that that would be a more useful Gradle support over in Cider since using the wrapper is super standard.

@ajoberstar ajoberstar added enhancement New feature or request area:cider labels Jul 29, 2022
@ajoberstar ajoberstar moved this from Todo to In Progress in Clojurephant Board Jul 31, 2022
@ajoberstar
Copy link
Member

I expect this to be fixed by clojure-emacs/cider#3228 and an upgrade to Clojurephant 0.7.0-alpha.6.

@ajoberstar ajoberstar self-assigned this Jul 31, 2022
@ajoberstar
Copy link
Member

The cider changes have been merged to master and should be in Cider's next release.

Repository owner moved this from In Progress to Done in Clojurephant Board Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:cider enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

3 participants