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

Python completion works only partially #599

Closed
mashu opened this issue Oct 23, 2016 · 4 comments
Closed

Python completion works only partially #599

mashu opened this issue Oct 23, 2016 · 4 comments

Comments

@mashu
Copy link

mashu commented Oct 23, 2016

Test case

Completion does not always work in the following test-case code:

from ete3 import Tree
t = Tree('((A,B),C);')
for n in t.traverse():
    list = []
    for c in n.get_children():
        print c.is_leaf()

Problem description

Where variables "t" and "list" complete fine. However "c" does not complete in emacs buffer.

Version of software

I tested this across Emacs 24.5, 25.1.1 (mainly using) and snapshot from 20161016. With ipython and python and even after wiping out completely my configuration and starting from scratch.

Company version: 0.9.0

My config file is at Emacs-init.org

Additional information

Interestingly when I switch to ipython buffor, there completion works just fine, but that is native ipython feature. I am not alone with this problem (reproducible by people on IRC).

Please help and let me know if you need more information.

@dgutov
Copy link
Member

dgutov commented Oct 23, 2016

What does M-x company-diag say?

@mashu
Copy link
Author

mashu commented Oct 24, 2016

The command M-x company-diag reports

Emacs 25.1.1 (x86_64-pc-linux-gnu) of 2016-10-11 on trouble
Company 0.9.0

company-backends: (company-yasnippet company-jedi company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
                   (company-dabbrev-code company-gtags company-etags company-keywords)
                   company-oddmuse company-dabbrev)

Used backend: company-capf
Prefix: ""
  "abs" "function"
...etc...

I tried also without company-jedi, as company-mode should support native completion to realise this strange behaviour

# Install by pip install ete3
from ete3 import Tree
t = Tree('((A,B),C);',format=1)

# For n. completion at point does not work
for n in t.traverse():
    print n.name
    print type(n)
# For y. completion at point works
for y in t:
    print y.name
    print type(y)

Both "y" and "n" variables are of the same type.
For both completion works in ipython buffer, but in emacs Elpy buffer it only works for "y".
With company-jedi mode, none of them gets completion.

@dgutov
Copy link
Member

dgutov commented Oct 24, 2016

Used backend: company-capf

That means that the native completion is used. You should M-x report-emacs-bug to see it fixed.

I tried also without company-jedi

Apparently, it's not used either way, since company-capf is behind it.

in emacs Elpy buffer it only works for "y"

I don't see the company-diag output for this case. But anyway, if you have problems with Elpy, you should report them to Elpy.

@sawan
Copy link

sawan commented Mar 21, 2017

Is this issue happening on a Mac computer?

I am having very similar problems but not on Windows Emacs 25.1.

@dgutov dgutov closed this as completed Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants