From 6f522c08939cfbe5f2993a093dd8302aa438fb57 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 6 Sep 2022 10:21:10 +1000 Subject: showing docs in hcel-ids mode, switch to buffer --- lisp/hcel-results.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lisp/hcel-results.el') 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)))) -- cgit v1.2.3