Closed vspinu closed 8 years ago
Hi, I have only few docsets activated and this isn't a big issue for me, but this multisource view looks very interesting. A PR implementing this would be very appreciated :-) If not, I will take a look at this in the future (my slot of free time is occupied by another project at this moment).
Does this feature is implemented and merged?
Does this feature is implemented and merged?
No. It's a proposal. Someone has to do it.
I think what we need is a better flex matching so that one can search for 'map', and then refine the search by typing ' clojure' . Currently, to narrow by docset, the docset name has to be in the beginning, and it has to match exactly (c-a is your friend). Also, it doesn't work with multiword docsets .
For example, I renamed Ruby on Rails.docset to 'ror.docset'.
Suboptimal, but it kinda solves the problem (in a hacky way though).
However, if someone sends a proposal (with code), we can evaluate it :)
right, The Ruby on Rails.docset is a problem. I rename it to RoR.docset
too.
That would be awesomely handy to have.
This should work:
(defun helm-def-source--helm-dash ()
(let ((connections (helm-dash-maybe-narrow-docsets helm-pattern)))
(cl-loop for docset in connections
append (list (helm-build-async-source (car docset)
:action-transformer #'helm-dash-actions
:candidates-process (cl-loop for row in (helm-dash--run-query docset)
collect (helm-dash--candidate docset row))
:delayed t
:persistent-help "View doc"
:requires-pattern helm-dash-min-length)))))
(defun helm-dash ()
"Bring up a Dash search interface in helm."
(interactive)
(helm-dash-initialize-debugging-buffer)
(helm-dash-create-common-connections)
(helm-dash-create-buffer-connections)
(helm :sources (helm-def-source--helm-dash)
:buffer "*helm-dash*"
:prompt "Doc for: "
:history 'helm-dash-history-input
:helm-candidate-number-limit 1000))
What I'm wondering is if this will play nice with the async stuff that this package does, especially with :candidate-process
. The code's kind of a mess (no lexical binding, not using Helm development conventions, etc.), and I haven't really been able to grok it yet.
With a few docsets activated, however, I haven't noticed any performance issues; in any case, Helm can handle a few tens of thousands of candidates without much problem.
Nicely done. Thank you!
Would be possible to have a multisource view - one source per doc set. It feels a bit unnatural to have all the docs in one bulk to me.