-
-
Notifications
You must be signed in to change notification settings - Fork 649
Description
Is your feature request related to a problem? Please describe.
Firstly this is an opinion that I hope is not taken in a negative way but as constructive feedback for cider. I'm a big fan of it. I appreciate your taking the time to read this.
Loading an additional alias such as :dev
or :test
when jacking in is a very common operation that in its current state I feel is overly difficult. Current solutions involve installing additional emacs packages such as dir-locals
and providing a per-project configuration that is used every time to load additional aliases at jack-in
time. Users are also able to use a prefix C-u
when doing a jack-in to provide additional arguments: ``. This is not discoverable in the CIDER documentation on the web or inside emacs. If it indeed is documented, I apologize but I have failed at finding it. I have only found reference to the prefix usage in the issue tracker here on github, or deep in the clojurians slack. I myself have asked how to load an alias there!
Additionally, after jacking in and getting a repl going, loading an alias requires the repl be stopped and re-started with that alias loaded explicitly. Some kind of porcelain in front of these manual steps would be nice.
Some examples of users getting tripped up can be found below:
- cider-jack-in-cljs failing to add deps from .dir-locals.el file as i expected. #3123
- Specify deps.edn alias #2396
This trips a number of people up who are new to cider, myself included. It can be a little frustrating trying to figure out how to do this.
Describe the solution you'd like
I'd like to propose a new configuration option that will instruct the interactive cider-jack-in command to prompt the user to select additional aliases to load when doing a jack-in
. Ideally, this configuration option (name tbd) will cause cider-jack-in to examine a user's deps.edn
or leiningen project.clj
(or etc) for additional aliases and explicitly prompt the user to select desired aliases to load in the minibuffer interactively.
I feel this is much better UX than a prefix or global configuration that may not be applicable to all projects, or installing dir-locals and then doing more configuration. Additionally, it would be opt-in and not disruptive to users. Cider documentation could call this out when instructing how to get up and running as well.
I'd also suggest this configuration option show this prompt when a user tells cider to restart a running repl.
Describe alternatives you've considered
Using dir-locals
I do not feel is a good solution because it requires an additional emacs package. Additionally users may not wish to use the same dir-locals config every time a jack-in
happens. Users should not have to install an additional package for this sort of thing.
Using cider-clojure-cli-global-options
has a similar issue as a persistant dir-locals
config in that it will load the same alias every time which may not be always desired. (For instance, this alias may not always exist or be differently named)
Using a prefix argument to cider-jack-in with the konami code emacs chord combo of C-u C-c C-x j j
works, but requires secret knowledge that cider-jack-in takes a prefix that allows you to specify an alias, and it is a lot to remember.
All the above options do indeed solve the problem of loading an additional alias, but I feel strongly that it could be made much easier for users with some kind of porcelain such as an interactive prompt.