Skip to content

Commit

Permalink
Don't lose the CIDER session over TRAMP files
Browse files Browse the repository at this point in the history
Fixes #3250
  • Loading branch information
vemv committed Aug 18, 2023
1 parent 9d2aa2c commit 8f2221f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [#3402](https://github.com/clojure-emacs/cider/issues/3402): fix `cider-format-connection-params` edge case for Emacs 29.
- [#3393](https://github.com/clojure-emacs/cider/issues/3393): Recompute namespace info on each shadow-cljs recompilation or evaluation.
- Recompute namespace info on each fighweel-main recompilation.
- [#3250](https://github.com/clojure-emacs/cider/issues/3250): don't lose the CIDER session over TRAMP files.
- Fix the `xref-find-definitions` CIDER backend to return correct filenames.
- Fix the `cider-xref-fn-deps` buttons to direct to the right file.
- Make TRAMP functionality work when using non-standard ports.
Expand Down
2 changes: 2 additions & 0 deletions cider-connection.el
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ REPL defaults to the current REPL."
(when (string-match-p "#uzip" file)
(let ((avfs-path (directory-file-name (expand-file-name (or (getenv "AVFSBASE") "~/.avfs/")))))
(setq file (replace-regexp-in-string avfs-path "" file t t))))
(when-let ((tp (cider-tramp-prefix (current-buffer))))
(setq file (string-remove-prefix tp file)))
(when (process-live-p proc)
(let* ((classpath (or (process-get proc :cached-classpath)
(let ((cp (with-current-buffer repl
Expand Down
2 changes: 1 addition & 1 deletion test/cider-common-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#22")
:to-equal "/ssh:[email protected]#22:")
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9")
:to-equal "/ssh:[email protected]#22:")
:to-equal "/ssh:[email protected]:")
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9" "12345")
:to-equal "/ssh:[email protected]#12345:")
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#12345")
Expand Down

0 comments on commit 8f2221f

Please sign in to comment.