summaryrefslogtreecommitdiff
path: root/cider-eldoc.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2016-04-08 09:55:25 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2016-04-08 09:55:25 +0200
commit2c01bfb5d2d99c7b278f79615037f05a24335498 (patch)
tree8ebc5014b0f16aa7269a3520b581a8bfc836a4d1 /cider-eldoc.el
parent66e1b4a64f116403c6008933aacb0a138c0493e4 (diff)
Cleanup the ns macro eldoc code
Diffstat (limited to 'cider-eldoc.el')
-rw-r--r--cider-eldoc.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/cider-eldoc.el b/cider-eldoc.el
index 2a607fa7..a6ca9d9d 100644
--- a/cider-eldoc.el
+++ b/cider-eldoc.el
@@ -147,16 +147,19 @@ if the maximum number of sexps to skip is exceeded."
nil
(list (cider-symbol-at-point) argument-index)))))
+(defun cider-eldoc--convert-ns-keywords (thing)
+ "Convert THING values that match ns macro keywords to function names."
+ (pcase thing
+ (":import" "clojure.core/import")
+ (":refer-clojure" "clojure.core/refer-clojure")
+ (":use" "clojure.core/use")
+ (":refer" "clojure.core/refer")
+ (_ thing)))
+
(defun cider-eldoc-info (thing)
"Return the info for THING.
This includes the arglist and ns and symbol name (if available)."
- ;; a dirty hack to handle the keywords used by the ns macro
- (let ((thing (pcase thing
- (":import" "clojure.core/import")
- (":refer-clojure" "clojure.core/refer-clojure")
- (":use" "clojure.core/use")
- (":refer" "clojure.core/refer")
- (_ thing))))
+ (let ((thing (cider-eldoc--convert-ns-keywords thing)))
(when (and (cider-nrepl-op-supported-p "eldoc")
thing
;; ignore empty strings