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

Checkouts no longer working #2446

Closed
lambda-ai opened this issue Sep 11, 2018 · 12 comments · Fixed by #2483
Closed

Checkouts no longer working #2446

lambda-ai opened this issue Sep 11, 2018 · 12 comments · Fixed by #2483
Assignees

Comments

@lambda-ai
Copy link

Expected behavior

When switching to a namespace for a code file that's in checkouts, the REPL should go there. Same for evaluating a form in that code file.

Actual behavior

Cider says "no linked CIDER sessions"

Steps to reproduce the problem

Create project with checkouts. Open file from one of the checkouts folders.

Environment & Version information

CIDER version information

;; CIDER 0.18.0 (Saigon), nREPL 0.2.13
;; Clojure 1.9.0, Java 1.8.0_181

Lein/Boot version

Leiningen 2.7.1

Emacs version

25.3.50.2

Operating system

Ubuntu 16.04

@lambda-ai
Copy link
Author

Looks like I can manually connect the file with cider-connect.

@vspinu
Copy link
Contributor

vspinu commented Sep 12, 2018

C-c C-s /p/d/b are for linking to contexts.

Automatic linking with checkouts is a bit tricky. One could inspect the path to the project and check if it's in checkouts, but for that to work it should be a symlinked path. So it's a bit brittle.

A generic solution which would work for all dependencies is to detect if a namespace is loaded and auto-link regardless of the project.

@vspinu vspinu self-assigned this Sep 12, 2018
@bbatsov
Copy link
Member

bbatsov commented Sep 12, 2018

There have been so many reports from users that want to eval code from random context into whatever their most recent REPL is that we should probably add an option to allow this.

There's at least 1 person complaining about the changes we've made every day. :-)

For that particular issue I agree with your second suggestion.

@lambda-ai
Copy link
Author

The current situation is fine, since connecting works. But since in the previous version it worked without the extra connect step, it caused some panic... :)

@jiacai2050
Copy link
Contributor

Same issue here.

The connecting solution break when multiple projects checkouts the same lib. I have to reconnect to different REPL to get thing work.

@vspinu
Copy link
Contributor

vspinu commented Sep 18, 2018

You don't need to connect a different repl. Just link to the existing REPL from the checked-out project (C-c C-s l/p/d/b).

Sorry for not bringing the fix as yet. Got sick last week and September is a busy month in here.

@lambda-ai
Copy link
Author

The lack of explicit support voor checkouts is burning me more than I thought after my previous comment: the problem is that the default repl will always see the maven version of the code by default, and I keep forgetting that changes to the other checkout projects arent visible until I do a repl install or after explicitly loading the code in the repl.

So actually the behavior seems to have changed by completely dropping support for checkouts, which was there in the previous version. Is this because you're creating the repl in a different way now?

I can imagine that others who depend on the checkouts mechanism are feeling the same pain...

@lambda-ai
Copy link
Author

not to mention of course that I keep forgetting to re-install when switching branches...

@bbatsov
Copy link
Member

bbatsov commented Sep 18, 2018

So actually the behavior seems to have changed by completely dropping support for checkouts, which was there in the previous version. Is this because you're creating the repl in a different way now?

Just for the sake of completeness - there was never any special support for checkouts. We simply weren't associating a project directory with a connection in the previous versions of CIDER, which meant you could eval files outside the project dir into whatever was the current REPL. I think that linking the checkouts dir to a project is a simple workaround for now.

The lack of explicit support voor checkouts is burning me more than I thought after my previous comment: the problem is that the default repl will always see the maven version of the code by default, and I keep forgetting that changes to the other checkout projects arent visible until I do a repl install or after explicitly loading the code in the repl.

I don't quite get what you mean here. I've never used checkouts before, so I'm not even sure how people are using them most of the time.

@lambda-ai
Copy link
Author

Hi Bozhidar,
the way it used to work is the way the mechanism in Leiningen is meant to work: when you load a file of the current project A in which you started the REPL, and which has checkouts to project B, the requires of project B would trigger a load from source from the project B source directory, not from whatever is in the maven repo. In the new cider version, the checkouts seem to be ignored, and the required namespaces from project B are resolved from the maven repo. Of course that defeats the purpose of the checkout mechanism.

@bbatsov
Copy link
Member

bbatsov commented Sep 18, 2018

I can't imagine how this can be related to the connection management changes - they simply establish file/buffer contexts for connections (think of this as a map telling CIDER which connection to use for operations related to each file/buffer) and the ability to group connections in a session. Everything else is exactly the same as it was before.

@lambda-ai
Copy link
Author

yeah, sorry about that: there was a typo causing this.
The checkouts do work fine. The only inconvenience is the explicit need to connect the source file to the repl process, which is ok to work around by manually connecting, since it's something that's very clear.

Sorry for the confusing remarks today.

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

Successfully merging a pull request may close this issue.

4 participants