Skip to content

Instantly share code, notes, and snippets.

@dpsutton
Created November 11, 2019 05:24
Show Gist options
  • Save dpsutton/bc8a0e10645f6be8aeb587ebf88a5dda to your computer and use it in GitHub Desktop.
Save dpsutton/bc8a0e10645f6be8aeb587ebf88a5dda to your computer and use it in GitHub Desktop.
find source and display
(defun cider-tooltip-source ()
(interactive)
(let* ((sym (thing-at-point 'symbol))
(response (cider-nrepl-send-sync-request
(list "op" "eval"
"code"
(format
"(do (require 'clojure.repl) (with-out-str (clojure.repl/source %s)))"
sym)))))
(when-let ((source (nrepl-dict-get response "value")))
(pos-tip-show (read source)
nil
nil
nil
-1))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment