Skip to content

Commit

Permalink
Enable Jedi 0.14.1 (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
steff456 authored and ccordoba12 committed Jul 24, 2019
1 parent f7380af commit 697ebb1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion pyls/plugins/jedi_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def _label(definition):


def _detail(definition):
return definition.parent().full_name or ''
try:
return definition.parent().full_name or ''
except AttributeError:
return definition.full_name or ''


def _sort_text(definition):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'future>=0.14.0',
'futures; python_version<"3.2"',
'backports.functools_lru_cache; python_version<"3.2"',
'jedi>=0.13.2,<0.14',
'jedi>=0.13.2,<0.15,!=0.14.0',
'python-jsonrpc-server>=0.1.0',
'pluggy'
],
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_jedi_completion(config):
items = pyls_jedi_completions(config, doc, com_position)

assert items
assert items[0]['label'] == 'isabs(s)'
assert items[0]['label'] == 'isabs(path)'

# Test we don't throw with big character
pyls_jedi_completions(config, doc, {'line': 1, 'character': 1000})
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_jedi_property_completion(config):
items = {c['label']: c['sortText'] for c in completions}

# Ensure we can complete the 'world' property
assert 'world' in items
assert 'world' in list(items.keys())[0]


def test_jedi_method_completion(config):
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/test_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_builtin_definition(config):

# No go-to def for builtins
doc = Document(DOC_URI, DOC)
assert [] == pyls_definitions(config, doc, cursor_pos)
assert len(pyls_definitions(config, doc, cursor_pos)) == 1


def test_assignment(config):
Expand Down
5 changes: 3 additions & 2 deletions test/plugins/test_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ def test_symbols(config):
config.update({'plugins': {'jedi_symbols': {'all_scopes': False}}})
symbols = pyls_document_symbols(config, doc)

# All four symbols (import sys, a, B, main, y)
assert len(symbols) == 5
# All four symbols (import sys, a, B, main)
# y is not in the root scope, it shouldn't be returned
assert len(symbols) == 4

def sym(name):
return [s for s in symbols if s['name'] == name][0]
Expand Down

0 comments on commit 697ebb1

Please sign in to comment.