Skip to content

Commit faa2aeb

Browse files
committed
Don't lose the CIDER session over TRAMP files
Fixes #3250
1 parent 1d8687b commit faa2aeb

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [#3331](https://github.com/clojure-emacs/cider/issues/3331): `cider-eval`: never jump to spurious locations, as sometimes conveyed by nREPL.
2323
- [#3112](https://github.com/clojure-emacs/cider/issues/3112): Fix the CIDER `xref-find-references` backend to return correct filenames.
2424
- [#3393](https://github.com/clojure-emacs/cider/issues/3393): recompute namespace info on each shadow-cljs recompilation or evaluation.
25+
- [#3250](https://github.com/clojure-emacs/cider/issues/3250): don't lose the CIDER session over TRAMP files.
2526
- Fix the `xref-find-definitions` CIDER backend to return correct filenames.
2627
- Fix the `cider-xref-fn-deps` buttons to direct to the right file.
2728
- Make TRAMP functionality work when using non-standard ports.

cider-connection.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ REPL defaults to the current REPL."
624624
(when (string-match-p "#uzip" file)
625625
(let ((avfs-path (directory-file-name (expand-file-name (or (getenv "AVFSBASE") "~/.avfs/")))))
626626
(setq file (replace-regexp-in-string avfs-path "" file t t))))
627+
(when-let ((tp (cider-tramp-prefix (current-buffer))))
628+
(setq file (string-remove-prefix tp file)))
627629
(when (process-live-p proc)
628630
(let* ((classpath (or (process-get proc :cached-classpath)
629631
(let ((cp (with-current-buffer repl

test/cider-common-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#22")
7171
:to-equal "/ssh:[email protected]#22:")
7272
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9")
73-
:to-equal "/ssh:[email protected]#22:")
73+
:to-equal "/ssh:[email protected]:")
7474
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9" "12345")
7575
:to-equal "/ssh:[email protected]#12345:")
7676
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#12345")

0 commit comments

Comments
 (0)