-
-
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
Enhance cider-connect
to show all nREPLs available ports, instead of only Leiningen ones
#3399
Changes from all commits
da52fee
b88d3cc
d366767
87c5404
2536f37
12388df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,18 +232,24 @@ PARAMS is as in `nrepl-make-buffer-name'." | |
|
||
(defun nrepl-extract-port (dir) | ||
"Read port from applicable repl-port file in directory DIR." | ||
(or (nrepl--port-from-file (expand-file-name "repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".nrepl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name "target/repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".shadow-cljs/nrepl.port" dir)))) | ||
(condition-case nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking to tackle this with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Sounds reasonable. Now that I think it, we may want to catch errors for each individual directory entry, instead of for the whole call, so that one bad dir doesn't cause all its neighbors to be excluded. |
||
(or (nrepl--port-from-file (expand-file-name "repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".nrepl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name "target/repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".shadow-cljs/nrepl.port" dir))) | ||
;; This operation can hit permission errors, particularly on macOS: | ||
(error nil))) | ||
|
||
(defun nrepl-extract-ports (dir) | ||
"Read ports from applicable repl-port files in directory DIR." | ||
(delq nil | ||
(list (nrepl--port-from-file (expand-file-name "repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".nrepl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name "target/repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".shadow-cljs/nrepl.port" dir))))) | ||
(condition-case nil | ||
(delq nil | ||
(list (nrepl--port-from-file (expand-file-name "repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".nrepl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name "target/repl-port" dir)) | ||
(nrepl--port-from-file (expand-file-name ".shadow-cljs/nrepl.port" dir)))) | ||
;; This operation can hit permission errors, particularly on macOS: | ||
(error nil))) | ||
|
||
(make-obsolete 'nrepl-extract-port 'nrepl-extract-ports "1.5.0") | ||
|
||
|
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.
We don't expect duplicates here?
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.
They're handled in the
cider--running-nrepl-paths
callsite. Which seems better sincecider-locate-running-nrepl-ports
cancons
an element to it, so you'd have to run seq-uniq again