-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Jumping to a library definition opens a file not bound to any CIDER session #2408
Comments
Something along those lines should be definitely implemented, but I am not sure atm what should be the right approach. Automatically linking buffers is the simplest of all but would create unnecessary noise for link management, specifically all those links will show in the session browser. Maybe custom jar context could be a way to go here. That is, don't associate with a buffer but with the whole jar. Similarly if a goto brings you into a dependency project it should also be automatically linked. And of course this behavior should be customisable. |
I want this implemented too. I think the whole jar library dependency is linked is better, what if you go deeper |
There's however the problem of going to the source of the same library from multiple sessions. That's why I like the simple propagation of the session of whatever you invoked
I like this idea. We just have to make sure the context would always switch to the last session from which a jar was accessed. |
This should happen automatically. When multiple associations are present they are disambiguated by recency. |
Fine by me. |
After I use |
For anyone looking for a quick fix while this gets sorted out, this does the trick (defun plexus-clojure-extras/around-cider-find-var (fn &rest args)
(let* ((sess (sesman-current-session 'CIDER))
(orig-buf (current-buffer))
(result (apply fn args)))
(unless (eq orig-buf (current-buffer))
(sesman-link-with-buffer (current-buffer) sess))
result))
(advice-add #'cider-find-var :around #'plexus-clojure-extras/around-cider-find-var) |
Frankly, I am not happy with how jars are currently treated. Opening each file at a time is unsatisfactory for a variety of reasons. I would like to have the full archive unpacked alongside jar and jump to a file within that unpacked directory. @bbatsov Do you have specific thoughts regarding this? Would it be ok to look at it on this occasion? |
Nevermind. Emacs has no built-in solutions for decmpressing the full archive, and I won't be writing one on this occasion. I will instead add a lookup for avfs indirection if available. |
I never thought much about this, but I've also never had serious problems with the current approach. |
Thanks a lot @vspinu! |
I have a workflow when I M-. into a function defined by a dependency. This opens a code buffer from the JAR, which I then can edit and evaluate forms to make some quick runtime-only hacks to the library. Now, with the connection handling rewrite, this changed – a buffer opened by M-. is not bound to a CIDER session (the message in the minibuffer is
No linked CIDER sessions
when I try to evaluate anything).The question is whether it would be sensible to propagate the current CIDER connection to any buffers opened by
Go to definition
.Meanwhile, I'm fine manually linking the buffer to the session for this particular usecase.
The text was updated successfully, but these errors were encountered: