anaconda-mode icon indicating copy to clipboard operation
anaconda-mode copied to clipboard

anaconda inhibits native python-shell completion and company-capf

Open vspinu opened this issue 8 years ago • 7 comments

Anaconda completion is static by definition. While working with shell interactively it's useful to have completions and eldoc for objects what are created interactively. Fortunately that's is already done by python-shell-completion-at-point in inferior and python-completion-at-point in script buffers. Both of these functions are in completion-at-point-functions lists.

Now, the problem is that anaconda overwrites C-M-i without falling back on completion-at-point-functions. Would you consider fixing this by either falling back on default completions, merging with default completions or adding anaconda completion to completion-at-point-functions?

There is a similar problem with anaconda-company which inhibit default company-capf. I am reporting this separately.

vspinu avatar Feb 19 '16 14:02 vspinu

BTW, the same rationale is valid for anaconda-mode-eldoc-function. It can fall back on python-eldoc-function when no completion was found.

vspinu avatar Feb 19 '16 14:02 vspinu

I don't think this is doable in easy way. All anconda-mode commands implemented as asynchronous callbacks executed on the server response. So there is a physical separation from the moment you hit M-. and actual go to definition action. That's why anaconda-mode override C-M-i key binding instead of providing its own complete at point function. The same technique applied to the eldoc mechanics.

proofit404 avatar Feb 19 '16 14:02 proofit404

How about checking for native python completion first and only when there is nothing on that end dispatch to the server side? I think there is little to lose here. Process completion is faster and if an object is defined emacs completion does a pretty good job there (at least it seems so to me).

vspinu avatar Feb 19 '16 15:02 vspinu

Does this mean anaconda-mode completion will not shows up if there is alive *Python* process? Also note that you can customize anaconda-mode-eldoc-callback and anaconda-mode-complete-callback. You can extend jedi result with inferior python completions.

proofit404 avatar Feb 19 '16 15:02 proofit404

Does this mean anaconda-mode completion will not shows up if there is alive Python process?

If there is a completion from python process then indeed, jedi is not queried. In all other case it does. I think it's not a big deal. Python objects will reflect the state of the most recent evaluation. This is what I personally always want. I mostly work interactively with data and my scratch buffers are so messy that jedi usually chokes.

Also note that you can customize anaconda-m

Aha. Thanks for the pointer. The python.el eldoc is not a big deal. It's worse than anaconda's one but it's still better than nothing when jedi fails for whatever reason.

vspinu avatar Feb 19 '16 21:02 vspinu

Is this still an issue?

CeleritasCelery avatar Sep 13 '19 14:09 CeleritasCelery

I cannot dwell into this ATM as I am not working with python for a while, but I would believe this to be still the case unless something radical changed on some of the parties involved.

vspinu avatar Sep 17 '19 13:09 vspinu