Skip to content

Commit 1afde95

Browse files
author
Ryan Smith
committed
Clean symbol before doing look up
If you attempt to run `cider-jump-to-var` to find the definition of an atom dereferenced with `@`, cider can't find the source location. If you remove the `@` cider has no issues finding the location. This allows for cleaning non-variable components out of a symbol before doing the look up to prevent this issue.
1 parent 32c2979 commit 1afde95

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cider-interaction.el

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,20 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation."
492492
(bounds-of-thing-at-point 'sexp)))
493493
(bounds-of-thing-at-point 'sexp)))
494494

495+
(defun cider--clean-symbol (symbol)
496+
"Return SYMBOL cleaned so a dictionary match can be found."
497+
(let* ((symbol (if (string-equal (substring symbol 0 1) "@")
498+
(substring symbol 1)
499+
symbol)))
500+
symbol))
501+
495502
;; FIXME: This doesn't have properly at the beginning of the REPL prompt
496503
(defun cider-symbol-at-point ()
497504
"Return the name of the symbol at point, otherwise nil."
498505
(let ((str (substring-no-properties (or (thing-at-point 'symbol) ""))))
499506
(if (equal str (concat (cider-current-ns) "> "))
500507
""
501-
str)))
508+
(cider--clean-symbol str))))
502509

503510
(defun cider-sexp-at-point ()
504511
"Return the sexp at point as a string, otherwise nil."

0 commit comments

Comments
 (0)