-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDO/helm support for apropos #1541
Comments
Yeah, we should cook something like this. Btw, you can add different action keys to We'll implement something using completing-read and the apropos results and people will be able to pick by themselves what completion system is used. |
Proof of concept for (require 'cider-apropos)
(defun cider-def-source--apropos (query)
(helm-build-sync-source (concat "CIDER apropos: '" query "'")
:action '(("Lookup doc" . cider-doc-lookup))
:candidates (mapcar (lambda (dict)
(nrepl-dbind-response dict (name type doc)
(let* ((label (capitalize (if (string= type "variable") "var" type)))
(help (concat "Display doc for this " (downcase label))))
(with-temp-buffer
(cider-propertize-region (list 'apropos-symbol name
'action 'cider-apropos-doc
'help-echo help)
(insert-text-button name 'type 'apropos-symbol)
(insert "\n")
(insert-text-button label 'type (intern (concat "apropos-" type)))
(insert ": ")
(let ((beg (point)))
(insert doc "\n")
(fill-region beg (point-max))))
(cons (buffer-string)
name)))))
(cider-sync-request:apropos query))
:multiline t))
(helm :sources (cider-def-source--apropos "def")
:buffer "*Helm CIDER apropos*") Tip: Turn on Other actions (e.g. What I don't understand is how "jumping to source" works. I've love to have that as an action, but |
It already exists - |
Basically instead of seeing the results in a dedicated buffer, you'll now see them in the minibuffer.
I've just added a couple of new commands - |
This works great. One suggestion, I'd love to give a default selection for |
File another issue about this and I'll look into it. |
Isn't Below is (defun cider-apropos-documentation-select ()
"Shortcut for (cider-apropos-select <query> nil t)."
(interactive)
(cider-ensure-connected)
(cider-ensure-op-supported "apropos")
(cider-apropos (read-string "Search for Clojure documentation (a regular expression): ") nil t)) And (defun cider-apropos-documentation ()
"Shortcut for (cider-apropos <query> nil t)."
(interactive)
(cider-ensure-connected)
(cider-ensure-op-supported "apropos")
(cider-apropos (read-string "Search for Clojure documentation (a regular expression): ") nil t)) |
Ops. I've made a silly copy-paste mistake. I've just fixed it. Thanks for bringing this up! |
@martintrojer Can you try out Helm CIDER? This issue was the motivation this (not-yet-released) package, and Helm CIDER apropos is the first feature. |
I tested it with IDO and it worked fine. |
Tested what with Ido? I don't use Ido, so I don't know its features. |
its a "completing" solution similar to helm. Both should work since the new cider function uses |
No, I meant try the new package I'm working on (not yet released). |
@xiongtx using your package, very slick thank you! 👍 |
Scenario; looking for a function somewhere in the codebase. All I have is the name.
M-x cider-apropos
does what I want, but I would prefer the results to feed ido/helm as I am typing. Then when a var is selected, a buffer is opened at the correct line.Also discussed here #1059
The text was updated successfully, but these errors were encountered: