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

Feature request: fallback connections #58

Closed
daveyarwood opened this issue Sep 2, 2019 · 2 comments
Closed

Feature request: fallback connections #58

daveyarwood opened this issue Sep 2, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@daveyarwood
Copy link
Sponsor Contributor

Conjure continues to be excellent, but I've noticed one minor pain point: there is no way for me to configure Conjure to use its own prepl whenever I don't have mine running.

I like that there is a default behavior where, if you don't have any connections configured in a conjure.edn in your project or home config directory, Conjure will fall back to using its own prepl so that you still get some good basic functionality. If I don't have a ~/.config/conjure/conjure.edn file, I can edit a one-off Clojure file (i.e. vim /tmp/foo.clj) and automatically get docstrings for Clojure core functions, evaluate forms, and so on.

The trouble is that I do have a ~/.config/conjure/conjure.edn in my home directory for general things that I want available everywhere, like a :cwd connection that connects to a prepl server that I've started in the current directory on a port specified in a .socket-port file. Because I have that, if I go to edit a one-off file like /tmp/foo.clj, Conjure fails to connect to the :cwd connection (because I haven't bothered to start a prepl server in /tmp) and I'm left with no active connections. I think it would be great if there were some way that I could still get the fallback Conjure prepl behavior in the scenario.


A couple of ideas:

  1. We could consider this always being the fallback behavior when all of your connections fail to connect. Although, you would probably want to know that that's happening, so a warning would be in order, like you mentioned in Evaluate in Conjure's JVM by default #31.

  2. We could go the explicit route and add an optional configuration key like :fallback, where you could specify another connection to use in the event that this one fails. Assuming the Conjure prepl has a publicly usable connection name like :conjure, then my :cwd connection config could look like: {:port #slurp-edn ".socket-port", :fallback :conjure}.

Either way, the idea is that when I run vim /tmp/foo.clj, once Conjure starts up, I see a warning that Conjure can't connect to :cwd, and it's using :conjure as a fallback.

@Olical Olical added the enhancement New feature or request label Sep 2, 2019
@Olical
Copy link
Owner

Olical commented Sep 2, 2019

Good idea! I think I worried about this a little when I was sorting out the inheritance of config files 🤔 I think I like the idea of just doing it automatically with a warning the most but I'll sleep on it 😄

@Olical
Copy link
Owner

Olical commented Sep 4, 2019

Released in v1.0.0 🎉 😄

@Olical Olical closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants