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
Elpy-doc completion breaks with ivy #1084
Comments
I'll just add that it happens to me, as well. |
Hello, and thanks for the report! Why do you think this is a problem that Elpy should fix, and not ivy-mode? Elpy seems to work fine? |
I believe it to be that helm and ivy are using standard interfaces for interacting with completion, so I guess elpy-doc should be utilizing these, I can't be sure. One of the other motivations for reporting here was due to your responsiveness |
I also don't know if helm and ivy use standard interfaces, but none of them work, so if is not an elpy related issue, it is related to both helm and ivy. |
|
well, I wouldn't say the are implementing standard facilities badly, almost literally every other function in emacs works with completion via ivy. though I understand your hesitation to include anything not standard/core to emacs. In the interim, do you know of a workaround to wrap elpy-doc? e.g. force a completion mechanism just for elpy-doc? maybe I should write a mini function that turns ivy on and off before/after calling elpy-doc? |
You could try an around-advice? I'm afraid I do not know ivy, and only use helm for very specific functions, so I do not know how to disable them for the parts of Emacs that they do not work with. |
I'll keep you updated if I come up with anything, thanks for your help |
issue opened in ivy: abo-abo/swiper#892 |
In my opinion, dynamic completion tables are a goofy interface that add an unnecessary layer of indirection.
Both helm and ivy sometimes have difficulty with this interface, because it often assumes that the default completion is being used. I suggest to migrate to the collection as a function interface: (defun elpy-doc--read-identifier-from-minibuffer (initial)
"Read a pydoc-able identifier from the minibuffer."
(completing-read "Pydoc for: "
(lambda (str pred _)
(elpy-rpc-get-pydoc-completions str))
nil nil initial 'elpy-doc-history)) The above approach is better for introspection as well, provided |
I'm not sure I understood all of your response, but I put it in a buffer and eval'd it, it did substitute the function, but no improvement in behavior was observed |
No, If you do not implement the full interface of the functionality you replace in core Emacs, I would suggest you to provide a way for your users to disable your mode where it breaks. |
( |
I prefer the |
I have to admit, "adheres to the interface preferred by the author of ivy" is not exactly high up on my list of reasons for choosing certain APIs over others. |
There's no need to escalate this, let's all remain calm :D |
@jorgenschaefer Just making a suggestion to improve your package. The alternative for your users is to employ crutches that turn off their preferred completion type, just because you're being suborn. |
Suggested solution to this problem: Use helm instead of ivy, as helm allows disabling the package where it does not implement the APIs it replaced correctly. |
To replicate:
M-x ivy-mode
M-x elpy-doc
type: 'datetime' + TAB, or try to expand to datetime.datetime, and you will find that you cannot. You can still type the full string 'datetime.datetime', and retrieve results, but somehow elpy-doc is not giving the appropriate readline info to ivy for completion after the first chunk of text. Similar behavior has been observed for helm as well.
Possible solutions:
The text was updated successfully, but these errors were encountered: