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 seems to rely on cider-nrepl #110

Closed
jjcomer opened this Issue Aug 21, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@jjcomer

jjcomer commented Aug 21, 2015

If I make a new project with leinigen (with an empty user profile) and only add refactor-nrepl I get an exception when running lein repl:

This breaks:

(defproject dep-test "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]]
  :plugins [[refactor-nrepl "1.1.0"]])

With the exception:

Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context, compiling:(/tmp/form-init8771389566932423289.clj:1:1477)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6730)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.analyze(Compiler.java:6485)
        at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3791)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6725)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.analyze(Compiler.java:6485)
        at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3791)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6725)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.access$300(Compiler.java:38)
        at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6129)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6723)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.analyze(Compiler.java:6485)
        at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5861)
        at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5296)
        at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3925)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6721)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.eval(Compiler.java:6779)
        at clojure.lang.Compiler.eval(Compiler.java:6772)
        at clojure.lang.Compiler.eval(Compiler.java:6772)
        at clojure.lang.Compiler.load(Compiler.java:7227)
        at clojure.lang.Compiler.loadFile(Compiler.java:7165)
        at clojure.main$load_script.invoke(main.clj:275)
        at clojure.main$init_opt.invoke(main.clj:280)
        at clojure.main$initialize.invoke(main.clj:308)
        at clojure.main$null_opt.invoke(main.clj:343)
        at clojure.main$main.doInvoke(main.clj:421)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context
        at clojure.lang.Util.runtimeException(Util.java:221)
        at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:698)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6723)
        ... 34 more

This works fine

(defproject dep-test "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]]
  :plugins [[refactor-nrepl "1.1.0"]
            [cider/cider-nrepl "0.9.1"]])

It seems there is a dep coming from cider-nrepl...

I'm on Ubuntu 15.04 -- Leiningen 2.5.2 on Java 1.8.0_60 Java HotSpot(TM) 64-Bit Server VM

@benedekfazekas

This comment has been minimized.

Member

benedekfazekas commented Aug 21, 2015

indeed, we have a provided dependency on it see:
https://github.com/clojure-emacs/refactor-nrepl/blob/master/project.clj#L18

and discussion of getting rid of this dependency: #40 apparently we decided to keep it.

do you have any particular reason not to pull cider-nrepl in as well?

@jjcomer

This comment has been minimized.

jjcomer commented Aug 21, 2015

Nope 😄
Just something I noticed tracking down another bug. We should probably add something to the README stating that you must also include cider for refactor to work.

@expez

This comment has been minimized.

Member

expez commented Aug 21, 2015

We could inline this, but 99% of our users already have this dep on the classpath so we'd affect the startup time of the repl (which is already horrible) adversely for very little benefit.

@expez expez closed this in 24e5091 Aug 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment