mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(lookup): dash docset lookup
This adapts to breaking API changes upstream.
Ref: emacsmirror/consult@ada079d593
Fix: #8305
Amend: 7088257f2e
This commit is contained in:
@ -74,16 +74,6 @@ Docsets can be searched directly via `+lookup/in-docsets'."
|
||||
;;
|
||||
;;; Commands
|
||||
|
||||
(defun +lookup--consult-search (sync cb)
|
||||
(lambda (action)
|
||||
(pcase action
|
||||
((pred stringp)
|
||||
(when-let (cands (with-current-buffer cb
|
||||
(dash-docs-search action)))
|
||||
(funcall sync 'flush)
|
||||
(funcall sync cands)))
|
||||
(_ (funcall sync action)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +lookup/in-docsets (arg &optional query docsets)
|
||||
"Lookup QUERY in dash DOCSETS.
|
||||
@ -103,22 +93,7 @@ installed with `dash-docs-install-docset'."
|
||||
(query (doom-thing-at-point-or-region query)))
|
||||
(doom-log "Searching docsets %s" dash-docs-docsets)
|
||||
(cond ((modulep! :completion vertico)
|
||||
(require 'consult)
|
||||
(dash-docs-initialize-debugging-buffer)
|
||||
(dash-docs-create-buffer-connections)
|
||||
(dash-docs-create-common-connections)
|
||||
(let* ((sink
|
||||
(thread-first (consult--async-sink)
|
||||
(consult--async-refresh-immediate)
|
||||
(+lookup--consult-search (current-buffer))
|
||||
(consult--async-throttle)))
|
||||
(result
|
||||
(or (consult--read sink
|
||||
:prompt "Documentation for: "
|
||||
:category 'dash
|
||||
:initial query)
|
||||
(user-error "Aborted"))))
|
||||
(dash-docs-browse-url (cdr (assoc result (funcall sink nil))))))
|
||||
(consult-dash query))
|
||||
((modulep! :completion ivy)
|
||||
(counsel-dash query))
|
||||
((modulep! :completion helm)
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
(when (modulep! +docsets)
|
||||
(package! dash-docs :pin "29848b6b347ac520f7646c200ed2ec36cea3feda")
|
||||
(when (modulep! :completion vertico)
|
||||
(package! consult-dash :pin "edb57bf8cdbef422b88667fadc83e1bb046957a6"))
|
||||
(when (modulep! :completion helm)
|
||||
(package! helm-dash :pin "7f853bd34da666f0e9a883011c80f451b06f6c59"))
|
||||
(when (modulep! :completion ivy)
|
||||
|
Reference in New Issue
Block a user