diff options
author | Yuchen Pei <hi@ypei.me> | 2022-09-06 10:21:10 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-09-06 10:21:10 +1000 |
commit | 6f522c08939cfbe5f2993a093dd8302aa438fb57 (patch) | |
tree | a744feea81e37cbd4d63d03f7ced6d8f23303cc8 /lisp/hcel-results.el | |
parent | de0447a69f58bbb55fd73cdc1e799c8e4705f128 (diff) |
showing docs in hcel-ids mode, switch to buffer
Diffstat (limited to 'lisp/hcel-results.el')
-rw-r--r-- | lisp/hcel-results.el | 11 |
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)))) |