Created
November 11, 2019 05:24
-
-
Save dpsutton/bc8a0e10645f6be8aeb587ebf88a5dda to your computer and use it in GitHub Desktop.
find source and display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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