Skip to content
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

AC candidates from Jedi.el are not merged with others #57

Open
tkf opened this issue May 19, 2013 · 4 comments
Open

AC candidates from Jedi.el are not merged with others #57

tkf opened this issue May 19, 2013 · 4 comments
Labels

Comments

@tkf
Copy link
Owner

tkf commented May 19, 2013

See the original report in #40.

@tkf
Copy link
Owner Author

tkf commented May 21, 2013

It turned out that it is nothing to do with async (as @MarSik suggested #40 (comment)). Instead, this happens because that AC can merge sources with the same "prefix" attribute. You can check that candidates from Jedi are merged with others if you remove this restriction by this patch on ac-prefix (WARNING: I find it very slow):

diff --git a/auto-complete.el b/auto-complete.el
index f04f3cb..37167b6 100644
--- a/auto-complete.el
+++ b/auto-complete.el
@@ -977,7 +977,7 @@ You can not use it in source definition like (prefix . `NAME')."
             (if point
                 (setq prefix-def prefix))))

-        if (equal prefix prefix-def) do (push source sources)
+        do (push source sources)

         finally return
         (and point (list prefix-def point (nreverse sources)))))

Here prefix and prefix-def are something like jedi:ac-direct-prefix or ac-prefix-default. prefix-def is the (to-be) chosen one.

Hopefully this restriction is removed in AC2. Pinging @MarSik, @asmeurer and @m2ym.

@asmeurer
Copy link
Contributor

Do you want me to test it or what? I don't know enough about the architecture of auto-complete to comment on the patch.

If this can't be done until AC2, would the workaround be to add the prefix to the emacs-jedi source (either in emacs-jedi or have users to it in their .emacs)?

@tkf
Copy link
Owner Author

tkf commented May 21, 2013

@asmeurer It's just to let you know status of the issue. I don't think there is a workaround except applying the above patch (I don't know if it is usable, though. Maybe you can put some conditions there to activate the patch only in Python buffer etc., to make it slightly more usable).

Other thing we can do is to implement equivalent of sources like words-in-buffer and dictionary at Python side, so that you can mix these candidates without changing jedi.el. Or adding more to Jedi's "dictionary" (I think there is only builtins; no conventional variable like __version__) could be enough.

@asmeurer
Copy link
Contributor

asmeurer commented Jun 4, 2013

I think the auto-complete Python dictionary is just dir(), dir(__builtins__), and the keywords (see d99051f6f32719b0ebda81a5dc4d0b9c97bc7943).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants