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

cider-connect: also look for Babashka nrepl servers #3489

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Conversation

vemv
Copy link
Member

@vemv vemv commented Sep 28, 2023

bb nrepls look like this in ps: bb --nrepl-server

A couple other refinements included.

No changelog is needed given there are already improvements under the same category.

Cheers - V

(replace-regexp-in-string "^n" "" s))))
(seq-filter #'identity)
car))
(port (thread-last (split-string (shell-command-to-string (concat "lsof -n -P -Fn -i -a -p " pid))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the -P flag, otherwise ports like 1667 would show up as netview-aix-7 since that's "well-known" name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can mention this in a comment for future reference.

(when (string-prefix-p "n" s)
(replace-regexp-in-string ".*:" "" s))))
(seq-filter #'identity)
(seq-filter (lambda (s)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some extra filtering, just in case.

cider.el Outdated
@@ -1914,29 +1914,34 @@ Use `cider-ps-running-lein-nrepls-command' and
(unless (eq system-type 'windows-nt)
(let ((non-lein-nrepl-pids
(thread-last (split-string
(shell-command-to-string "ps u | grep java | grep -v leiningen | grep nrepl.cmdline")
(shell-command-to-string "ps u | grep -E 'java|nrepl.cmdline|--nrepl-server' | grep -v -E 'leiningen|grep'")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to mention in a comment example of things this command is supposed to match. (e.g. using clj and bb)

@vemv
Copy link
Member Author

vemv commented Sep 29, 2023

Thanks! All done.

@vemv vemv merged commit b39d8fa into master Sep 29, 2023
@vemv vemv deleted the cider-connect-bb branch September 29, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants