summaryrefslogtreecommitdiff
path: root/cider-util.el
diff options
context:
space:
mode:
authorChaitanya Koparkar <ckoparkar@live.in>2016-05-05 20:21:36 +0530
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2016-05-05 07:51:36 -0700
commit42776938e87985cc6dd09f5234c085be433501c0 (patch)
tree83ed2f355e205aab98cacac264a9340e61678148 /cider-util.el
parent1f6fc8d64d50b24fa87491e6b208872cff5ef11d (diff)
[Fix #1725] Display class names in eldoc for interop forms (#1729)
The class information returned by `eldoc` middleware op is used. clojure-emacs/cider-nrepl#349
Diffstat (limited to 'cider-util.el')
-rw-r--r--cider-util.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/cider-util.el b/cider-util.el
index 462e8f00..9ae52789 100644
--- a/cider-util.el
+++ b/cider-util.el
@@ -35,6 +35,7 @@
(require 'cl-lib)
(require 'clojure-mode)
(require 'cider-compat)
+(require 'nrepl-dict)
(defalias 'cider-pop-back 'pop-tag-mark)
@@ -123,6 +124,16 @@ find a symbol if there isn't one at point."
(forward-sexp -1)))
(cider-symbol-at-point)))))
+(defun cider-ns-thing-at-point ()
+ "Return destructured `cider-symbol-at-point'.
+If the symbol at point is of the form ns-name/thing-name, returns a dict
+\(\"ns\" \"ns-name\" \"thing\" \"thing-name\")."
+ (let* ((sym (cider-symbol-at-point))
+ (ns-thing (split-string sym "/")))
+ (if (< (length ns-thing) 2)
+ (nrepl-dict "thing" (car ns-thing))
+ (nrepl-dict "ns" (car ns-thing) "thing" (cadr ns-thing)))))
+
;;; sexp navigation
(defun cider-sexp-at-point (&optional bounds)