Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Working with a remote REPL does not enable cider-mode when opening local files #2520

Closed
behrica opened this issue Nov 16, 2018 · 8 comments
Closed
Labels

Comments

@behrica
Copy link
Contributor

behrica commented Nov 16, 2018

Expected behavior

Opening a local clj file, while connected to a remote repl, should enable cider mode automatically . And after this the evaluation of code should work and happen on the remote REPL.

Actual behavior

Cider-mode does not get enabled, it stays in clojure-mode only. And therefore the "cider eval" commands are not working.
Typying manually "cider-mode" in the buffer does work and the code evaluation works as expected

Steps to reproduce the problem

  1. Open a local project.clj file
  2. connect to a remote repl with (cider-connect '(:host "serveo.net" :port 35868 :project-dir "/home/carsten/Dropbox/sources/expertDossier") )
    This establishes the connection and the repl can be used.
  3. the current "project.clj" seems to be associated with the repl session, and cider mode is enabled
  4. the sesman browser seems to suggest that things are linked:
    CIDER Sessions:

1: sources/expertDossier:serveo.net:35868
linked-to: proj(~/Dropbox/sources/expertDossier/)
objects: cider-repl %s(clj)

  1. open a new local clojure file in the same project does NOT enable cider mode.
    (running "cider-mode" by hand does work and enable it and it shows the connection information in the mode line)

Environment & Version information

CIDER version information

;; Connected to nREPL server - nrepl://serveo.net:35868
;; CIDER 0.19.0snapshot (package: 20181110.1413), nREPL 0.2.12
;; Clojure 1.9.0, Java 1.8.0_181

Lein/Boot version

Leiningen 2.8.1 on Java 1.8.0_192 OpenJDK 64-Bit Server VM

Emacs version

emacs 26.1

Operating system

arch linux

@behrica
Copy link
Contributor Author

behrica commented Nov 16, 2018

My use case could be helped by #2506,
because with it I could use the interactive "cider-connect" instead of my own function.

I am not sure, if this would fix the issue of not enabling cider-mode, as described here.

@mallt
Copy link
Contributor

mallt commented Nov 16, 2018

Just a quick check, is the value of cider-auto-mode set to t in your config?

@behrica
Copy link
Contributor Author

behrica commented Nov 16, 2018

I did not change it, so I assume yes.

@behrica
Copy link
Contributor Author

behrica commented Nov 16, 2018

I looked into it in more detail, and it seems to be related to the fact, that I call "cider-connect" non-interactive.

I saw as well that after the remote repl is started, my clojure-mode-hook indeed misses the "cider-mode".

So somehow the non interactive call of "cider-connect" fails to add the cider-mode into the clojure-mode-hooks

@behrica
Copy link
Contributor Author

behrica commented Nov 16, 2018

I figured out the problem.

The described behavoiur happens only when the active buffer , while I run cider-connect, is not a project file.

When I run the cider-connect, while for example project.clj is open, it works as expected.

This is maybe a bit confusing, I would say

When connecting to a remote repl it is not obvious, why the current active buffer should have any influence... Specially because I need to set the ":project-dir" explicitly.

I would find it rather "normal" that I can connect to a remote repl, without having any file open in emacs.

So my assumption would be that all clojure files in :project-dir are "automatically" associated with the repl

@behrica
Copy link
Contributor Author

behrica commented Nov 16, 2018

I tried the PR #2506 and it would indeed solve my problem,
and we could therefore close this, once the PR is applied.

@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label May 8, 2019
@stale
Copy link

stale bot commented Jun 7, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Jun 7, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants