-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
[Fix #949] Define custom cider-default-project-type. #951
[Fix #949] Define custom cider-default-project-type. #951
Conversation
3f66b39
to
7e89932
Compare
Of we can simply check which command is available on the |
@bbatsov $PATH will probably have both lein and boot for many Clojure users, though. What should the defcustom be called? cider-default-command maybe? |
cider-default-repl-command ? |
As there are already |
@vspinu I think putting the word 'boot' into the var would be a little confusing... But I'm also not sure I see the advantage in making it a list rather than just one custom var that the user can change if necessary -- can you explain? I've changed the var name per @bbatsov 's request and am resubmitting the PR but if need be I can rework this more. |
Custom var is used with `cider-jack-in` when connecting to project-less REPLs.
7e89932
to
73f9271
Compare
If I understand correctly lein and boot are better described as boot tools and not project types (as
The idea is that cider should go through the list of available tools and pick the first tool for which the executable is available. This way the user who has only boot on the system will not need to customize anything. The same variable gives the preferred order of Having a comprehensive list of backends is a good idea in general. Your code becomes aware of all available tools and a lot of code could be written generically. |
@vspinu Re: terminology, yeah, "projects" are the Leiningen-inspired parlance for Clojure ... repositories. So I stuck with that. Boot might be "build", given Regarding line 170, it is a little bit of a shortcut, since our backend-agnostic functions dispatch off of either the strings "lein" or "boot" -- the same set of values that make sense for Anyhow thanks for the input and explanations. |
Yes. I saw that, but it contains a meta assumption that The boot documentation calls itself |
Projectile has long been using a terminology like |
@@ -98,6 +98,15 @@ version from the CIDER package or library.") | |||
:group 'cider | |||
:package-version '(cider . "0.9.0")) | |||
|
|||
(defcustom cider-default-repl-command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't quite like this, as it's not clear this is a command used to start/run an nREPL server. Maybe the more descriptive cider-start-nrepl-server-command
. The command doesn't have to be tied to lein
or boot
at all. Someone might like to start nREPL
using java -jar ...
.
As I noted in a code comment - when you're outside of a On the other hand - anything else you're using should provide |
This is probably true inside lein/boot projects as well. One might want to have a custom startup commands without altering This is why The current API could be rewritten generically. For example:
BTW, |
I would like to mention that right now cider is broken for files not in projects, and this would fix it. It cannot start a server to connect to, as cider-project-type returns nil. |
[Fix #949] Define custom cider-default-project-type.
I'll merge this to spare users of the MELPA package the pain of dealing with the existing bug, but this is something that we can definitely improve upon. |
@bbatsov I think that's prudent; a more robust, future-proof solution would best be tackled by someone else for now. |
Custom var is used with
cider-jack-in
when connecting to project-less REPLs.(Both Leiningen and Boot support REPLs outside of projects: Cider users can choose which command to default to.)