aboutsummaryrefslogtreecommitdiff
path: root/lisp/hcel-results.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-06 10:21:10 +1000
committerYuchen Pei <hi@ypei.me>2022-09-06 10:21:10 +1000
commit6f522c08939cfbe5f2993a093dd8302aa438fb57 (patch)
treea744feea81e37cbd4d63d03f7ced6d8f23303cc8 /lisp/hcel-results.el
parentde0447a69f58bbb55fd73cdc1e799c8e4705f128 (diff)
showing docs in hcel-ids mode, switch to buffer
Diffstat (limited to 'lisp/hcel-results.el')
-rw-r--r--lisp/hcel-results.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/hcel-results.el b/lisp/hcel-results.el
index d623d59..63f3c91 100644
--- a/lisp/hcel-results.el
+++ b/lisp/hcel-results.el
@@ -228,7 +228,13 @@ Start by choosing a package."
hcel-results-max-page-number))
(mapc
(lambda (result)
- (let ((location-info (alist-get 'locationInfo result)))
+ (let* ((location-info (alist-get 'locationInfo result))
+ (doc (hcel-render-html
+ (or (alist-get 'doc result)
+ (alist-get 'documentation
+ (ignore-errors
+ (hcel-definition-site-location-info
+ location-info)))))))
(insert "--\n")
(insert (propertize
(format "%s :: %s\n"
@@ -239,7 +245,8 @@ Start by choosing a package."
(insert (format "Defined in %s %s\n"
(hcel-format-package-id
(alist-get 'packageId location-info) "-")
- (alist-get 'modulePath location-info)))))
+ (alist-get 'modulePath location-info)))
+ (when doc (insert doc))))
(alist-get 'json results))
(goto-char (point-min))))