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

Autocomplete doesn't always work #239

Open
yay opened this issue Oct 13, 2016 · 5 comments
Open

Autocomplete doesn't always work #239

yay opened this issue Oct 13, 2016 · 5 comments

Comments

@yay
Copy link

yay commented Oct 13, 2016

For example:

screen shot 2016-10-13 at 14 11 54

However, when I fully type the method's name, go to definition does work, e.g.:

ax = plt.axes()

but then for something like this, it doesn't:

ax.arrow(...)
@sadovnychyi
Copy link
Member

Yep. can catch an exception in this case:

autocomplete-python: autocomplete-python traceback output:     return self._eval_element_cached(element)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/cache.py", line 41, in wrapper
    rv = function(obj, *args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/__init__.py", line 280, in _eval_element_cached
    return self._eval_element_not_cached(element)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/debug.py", line 81, in wrapper
    return func(*args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/__init__.py", line 300, in _eval_element_not_cached
    types = self._eval_atom(element.children[0])
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/__init__.py", line 358, in _eval_atom
    return self.find_types(scope, atom, stmt.start_pos, search_global=True)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/__init__.py", line 143, in find_types
    return f.find(scopes, attribute_lookup=not search_global)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/debug.py", line 81, in wrapper
    return func(*args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/finder.py", line 104, in find
    types = self._names_to_types(names, attribute_lookup)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/finder.py", line 293, in _names_to_types
    new_types = _name_to_types(self._evaluator, name, self.scope)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/cache.py", line 41, in wrapper
    rv = function(obj, *args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/finder.py", line 348, in _name_to_types
    types = _eval_param(evaluator, typ, scope)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/finder.py", line 443, in _eval_param
    res_new |= dynamic.search_params(evaluator, param)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/debug.py", line 81, in wrapper
    return func(*args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/dynamic.py", line 65, in search_params
    names = [n for n in search_function_call(evaluator, func)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/cache.py", line 41, in wrapper
    rv = function(obj, *args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/dynamic.py", line 137, in search_function_call
    evaluator.eval_trailer([typ], trailer)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/__init__.py", line 406, in eval_trailer
    new_types |= self.execute(typ, node, trailer)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/debug.py", line 81, in wrapper
    return func(*args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/__init__.py", line 441, in execute
    types = func(arguments)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/representation.py", line 389, in py__call__
    return Function.py__call__(self, params)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/_compatibility.py", line 180, in <lambda>
    return lambda *args, **kwargs: self.func(*args, **kwargs)
  File "/Users/sadovnychyi/autocomplete-python/lib/jedi/evaluate/representation.py", line 588, in py__call__
    if self.base.is_generator():
AttributeError: 'Class' object has no attribute 'is_generator'

Likely related to Jedi.

@yay
Copy link
Author

yay commented Oct 13, 2016

Ah, I see. Is this a regression, or has it always been like this?

@jwz-ecust
Copy link

autocomplete-python traceback output:
from numpydoc.docscrape import NumpyDocString
File "/usr/local/lib/python2.7/site-packages/numpydoc/init.py", line 3, in
Close All
autocomplete-python traceback output:
from .numpydoc import setup
File "/usr/local/lib/python2.7/site-packages/numpydoc/numpydoc.py", line 29, in
from sphinx.util.compat import Directive
File "/usr/local/lib/python2.7/site-packages/sphinx/util/init.py", line 27, in
from docutils.utils import relative_path
File "/usr/local/lib/python2.7/site-packages/docutils/utils/init.py", line 20, in
import docutils.io
File "/usr/local/lib/python2.7/site-packages/docutils/io.py", line 18, in
autocomplete-python traceback output:
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/usr/local/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
autocomplete-python traceback output:
return _parse_localename(localename)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

@sadovnychyi
Copy link
Member

@jwz-ecust
Copy link

@sadovnychyi Fixed, thank u! I used to update my .zshrc file.

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