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

clj repl is associated with cljs buffer #1511

Closed
gdanov opened this issue Jan 12, 2016 · 17 comments
Closed

clj repl is associated with cljs buffer #1511

gdanov opened this issue Jan 12, 2016 · 17 comments

Comments

@gdanov
Copy link

gdanov commented Jan 12, 2016

Using latest cider+helm+projectile+pespective

some debug info for the cljs buffer:

  • nrepl-project-dir -> nil
  • cider-repl-type -> clj
@bbatsov
Copy link
Member

bbatsov commented Jan 12, 2016

What do you call latest - snapshot or 0.10.1?

@gdanov
Copy link
Author

gdanov commented Jan 12, 2016

snapshot: cider 20160104.1114

@Malabarba
Copy link
Member

Those two variables are only relevant in repl buffers (their values make no difference in source files).

Could you please check the value of both of those variables in your clojure REPL buffer and in your ClojureScript REPL buffer?

@gdanov
Copy link
Author

gdanov commented Jan 12, 2016

Of course...but first, steps to reproduce:

  • open .cljs buffer via projectile
  • C-c M-J
  • C-c C-z => switch to the cljs repl
  • open .clj file
  • in the .clj buffer C-c C-z => switch to the clj repl
  • switch to the .cljs buffer, C-c C-z => switch to the clj repl

values:

  • in the clj repl
    • nrepl-project-dir => "~/work/playground/crowl/" (correct)
    • cider-repl-type => "clj"
  • in the cljs repl
    • nrepl-project-dir => "~/work/playground/crowl/" (correct)
    • cider-repl-type => "cljs"

Some other observations:

  • C-c M-o says "There's no other REPL for the current project"
  • cider-assoc-buffer-with-connection works (until I restart the repl server)

@Malabarba
Copy link
Member

Is this still an issue? The related code has changed a bit over the last month, and I can't reproduce this now.

@gdanov
Copy link
Author

gdanov commented Feb 25, 2016

yes, it's messy. Pls let me know which components I should update. Is it only cider or also the repl plug-ins

@Malabarba
Copy link
Member

  1. Upgrade cider, seq, and clojure-mode in the Emacs' package manager (if you use clj-refactor, upgrade it too).
  2. Remove any mentions of the cider/cider-nrepl dep from your build.boot (if you have refactor-nrepl remove that too).

@gdanov
Copy link
Author

gdanov commented Feb 25, 2016

updated and gave it a try. I use figwheel now and always start the repl outside of emacs.
there is no automatic association of the .cljs buffers with the cljs repl, but once I manually associate the buffer with the repl, the association stays.
so, it's not messy anymore. just not automatic.

@Malabarba
Copy link
Member

Do you use cider-connect? If so, do you associate that repl buffer with a project directory?

@gdanov
Copy link
Author

gdanov commented Mar 1, 2016

yes, that's what I use. The clojurescript is started via
(use 'figwheel-sidecar.repl-api)
(cljs-repl)

associating the repl buffers with the project makes no difference. If I have clj and cljs repls and open new cljs file, it's associated with the clj repl by default

@Malabarba
Copy link
Member

I just pushed a change that might fix this.
Could you try upgrading to the latest snapshot?

It should be on Melpa in about an hour.

@gdanov
Copy link
Author

gdanov commented Mar 3, 2016

I upgraded. Just a reminder — I have switched the workflow to using cider-connect so this is what I am testing.

what I see currently is that the cljs repl reports to be clj repl type.

Also when I connect fresh, the helm-buffer-list does not show the repl in the project list. I don't know if it's different symptom. once I switch to the fresh repl buffer via ibuffer other-window the project folder is correct

maybe I am testing differently from you? can you describe your testing scenario?

@Malabarba
Copy link
Member

what I see currently is that the cljs repl reports to be clj repl type.

OK. This is something we can focus on.
Do you get any warnings when you connect to the REPL?

@gdanov
Copy link
Author

gdanov commented Mar 3, 2016

that's what I see in the messages

REPL buffer already exists (cider-repl localhost). Do you really want to create a new one? (y or n) y
nREPL: Establishing direct connection to localhost:63819 ...
nREPL: Direct connection established
Connected. May the Source shine upon thy REPL!

and some details on the plug-ins

 :profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
                                  [figwheel-sidecar "0.5.0-1"]]
                   :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}
             :repl {:source-paths ["dev"]
                    :plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
                                        ; [refactor-nrepl "2.2.0-SNAPSHOT"]
                              ]}}

@Malabarba
Copy link
Member

that's what I see in the messages

If there are warnings, they'll be printed in red color on the REPL buffer after you connect. Do you see anything there? (besides the welcome banner)

@gdanov
Copy link
Author

gdanov commented Mar 4, 2016

this is what I see

WARNING: The following nREPL ops are not supported:
artifact-list artifact-versions clean-ns extract-definition find-symbol find-used-locals hotload-dependency namespace-aliases rename-file-or-dir resolve-missing stubs-for-interface find-used-publics version warm-ast-cache warm-macro-occurrences-cache
Please, install (or update) refactor-nrepl and restart the REPL.
You can mute this warning by changing cljr-suppress-middleware-warnings.
WARNING: CIDER's version (0.11.0) does not match cider-nrepl's version (0.11.0-snapshot). Things will break!
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.2.0-SNAPSHOT (package: 20160303.536) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.

Please note that I don't have the refactor plug-in enabled and that I run the cider snapshot version which is now actually the release one

@gdanov
Copy link
Author

gdanov commented Mar 11, 2016

took time to reinstall emacs from scratch. the problem can't be reproduced with the clean install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants