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
Introduce external server configuration #66
Conversation
src/clojure/nrepl/config.clj
Outdated
(catch java.io.IOException e | ||
(printf "Couldn't open '%s': %s\n" source (.getMessage e))) | ||
(catch RuntimeException e | ||
(printf "Error parsing edn file '%s': %s\n" source (.getMessage e))))) |
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.
Why do we catch these exceptions at all?
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.
Good point! I was just playing with some things here. I guess I should just clean this up and silently return nil
or {}
.
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
=========================================
- Coverage 79.44% 77.85% -1.6%
=========================================
Files 12 13 +1
Lines 978 1025 +47
Branches 33 34 +1
=========================================
+ Hits 777 798 +21
- Misses 168 193 +25
- Partials 33 34 +1
Continue to review full report at Codecov.
|
Looks convincing to me, though this is my first time reading nrepl code 👍. |
58c1a0a
to
cd64a3f
Compare
This avoid a dependency on the order of the localhost records in /etc/hosts. Normally first there's a record for 127.0.0.1 (ipv4 loopback address) and then there's a record for ::1 (ipv6 loopback address), so normally you'd end up using the ipv4 address, but that's not guaranteed. I'd rather us have a stable and explicit default.
If you have .nrepl-config.edn in the folder you invoke nREPL from it will take precedence over whatever is in `.nrepl/config.edn`. That might be very handy for project specific configuration - e.g. fixed port per project, fixed transport, etc.
56f2200
to
0a6d57b
Compare
Awesome PR, this is my way forward from now on thanks! |
That's something I've been thinking about for a long time and it's finally coming in 0.5 (after a polish it and add some docs).
Basically the idea is to make it easier to have host-wide and project-specific configs, so you can have stable bind-addresses, ports, transports, middleware, etc.
Obviously that's also going to require a bit of changes to tools like
boot
andlein
, but those are going to be trivial. Feedback is welcome!I also plan to follow this up with
clj
writing in.nrepl/
some information about each running server, so it's easy for something like CIDER to just go check this dir and suggest all the local running instances as something you can connect to. That's going to be a massive improvement over theps
grepping we do right now and will finally work on Windows as well. :-)