Skip to content

Commit 6055683

Browse files
vspinubbatsov
authored andcommitted
Rely on cider-find-file when locref cannot be resolved by info middleware
1 parent 7a53a92 commit 6055683

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cider-repl.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,13 @@ regexes from `cider-locref-regexp-alist' to infer locations at point."
10461046
(if-let ((loc (cider-locref-at-point pos)))
10471047
(let* ((var (plist-get loc :var))
10481048
(line (plist-get loc :line))
1049-
(file (if var
1050-
(or (cider-sync-request:ns-path var)
1051-
(nrepl-dict-get (cider-sync-request:info var) "file"))
1052-
(plist-get loc :file))))
1049+
(file (or
1050+
;; retrieve from info middleware
1051+
(when var
1052+
(or (cider-sync-request:ns-path var)
1053+
(nrepl-dict-get (cider-sync-request:info var) "file")))
1054+
;; when not found, return the file detected by regexp
1055+
(plist-get loc :file))))
10531056
(if file
10541057
(cider--jump-to-loc-from-info (nrepl-dict "file" file "line" line))
10551058
(error "No source location for %s" var)))

0 commit comments

Comments
 (0)