-
-
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
cider-switch-to-relevant-repl-buffer tramples cider-switch-to-repl-buffer #435
Comments
C-c C-z in cider-repl-mode is wrong in the README, it switches user to the file of where the repl was instantiated. Pretty funky, but undocumented. C-u C-u C-c C-z should not be there at all in the cider-repl-mode part of README. |
Actually, C-c C-z for cider-repl-mode is partially correct. It does "select the last Clojure buffer" which matches the docstring for cider-switch-to-last-clojure-buffer. However it's wrong in that C-u C-c C-z will "switch the Clojure buffer to the namespace in the current buffer." That doesn't make sense. I'd say also that "Select the last Clojure buffer. " is just too vague. |
Yep, the docstrings seem to need some improving. |
Yup, though my main point in this issue is what exactly does C-c C-z do? |
Well, it seems that we can't use |
Are you sure about the "relevance" behavour being split out of the standard C-c C-z that used to be there? In general I'd be interested to know what feedback there is for what features ppl use.. |
AFAIR the relevance behaviour wasn't working properly if someone was connecting to a remote nREPL instance. |
It wasn't that it didn't work properly using a remote nREPL instance, more that the functionality wasn't desirable according to @vedang in #361 (see his initial comment in the issue). Options as I see them:
Just occurred to me that we could update the relevance behavour to output a message making it clear what repl has been switched into. |
To add my 2 cents, I would prefer the two functions to remain separate and have separate key bindings. The default behavior, mapped to C-c C-z, should be |
I refreshed my knowledge of the issue and I think a single command might be more sensible provided it features some safeguards when there is ambiguity as to which REPL to select (maybe it could prompt the user to manually select the proper REPL buffer). Having a message displayed when the REPL buffer was changed would be a nice improvement as well. Btw, those changes would be needed even if we decide to keep around the two separate commands. That said - I'm also OK with having two separate commands. The downside is this approach would be only that fewer people would understand about the presence of this behaviour. |
It's good we're rethinking this. I'm concerned with having 2 commands as it makes using CIDER more complicated than it need be. We've had a couple of warnings in that the docs couldn't keep up and we didn't notice that one of the commands was inaccessible via a keybinding. If we decide we can't merge the two commands another option is to drop the 'relevance' behavour or to move it out as an extension. I'm happy to do some more work on this as I don't want to leave it in a messy state, but it needs a consensus first. Digging into @bbatsov's comment around providing "safeguards when there is ambiguity as to which REPL to select" - Yes we can do this. To be clear, as soon as you open up a remote nREPL session there will be ambiguity, as you can't tie the remote session to a project in a directory structure. Having a communicative safeguard that doesn't attempt any cleverness in this situation might be sensible, and might alleviate @vedang's concern? |
I guess it will. I should mention that people have been using |
OK. Unless anyone objects I'll begin a pull request based on this conversation. Once my new year hangover has abated that is. |
@bbatsov the code has been working because of a check on L193 in @jonpither looking at the code for |
To clarify further, ^ this is working because people generally don't tend to mix |
@jonpither Ping :-) Any progress with this? |
I'm hoping to spend Friday on it. |
Fixed in #451 |
Some issues around cider-switch-to-relevant-repl-buffer and cider-switch-to-repl-buffer.
This is around #361, where @vedang split cider-switch-to-relevant-repl-buffer out of cider-switch-to-repl-buffer.
In my setup, C-c C-z still calls cider-switch-to-relevant-repl-buffer, even though it's mapped to C-c C-Z. A little research makes me think both C-c C-Z and C-c C-z cannot co-exist mapped to different actions. Users might now be using the "relevance" feature without realising it's the unintended function.
There is no mention of C-c C-Z in the README.
In the readme I think C-u C-u C-c C-z is wrong. C-u C-c C-Z does what is described, and now there is no way of doing both selecting a project-dir via IDO and switching to the NS based on the current NS. This may not be a big deal but the docstrings are incorrect.
The if statement in cider-switch-to-relevant-repl-buffer now has 3 clauses. It seems to work still but I'm not entirely sure why.
The text was updated successfully, but these errors were encountered: