diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2016-04-08 09:55:25 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2016-04-08 09:55:25 +0200 |
commit | 2c01bfb5d2d99c7b278f79615037f05a24335498 (patch) | |
tree | 8ebc5014b0f16aa7269a3520b581a8bfc836a4d1 /cider-eldoc.el | |
parent | 66e1b4a64f116403c6008933aacb0a138c0493e4 (diff) |
Cleanup the ns macro eldoc code
Diffstat (limited to 'cider-eldoc.el')
-rw-r--r-- | cider-eldoc.el | 17 |
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 |