Skip to content

Commit 697ebb1

Browse files
steff456ccordoba12
authored andcommitted
Enable Jedi 0.14.1 (#625)
1 parent f7380af commit 697ebb1

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

pyls/plugins/jedi_completion.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ def _label(definition):
8989

9090

9191
def _detail(definition):
92-
return definition.parent().full_name or ''
92+
try:
93+
return definition.parent().full_name or ''
94+
except AttributeError:
95+
return definition.full_name or ''
9396

9497

9598
def _sort_text(definition):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
'future>=0.14.0',
3737
'futures; python_version<"3.2"',
3838
'backports.functools_lru_cache; python_version<"3.2"',
39-
'jedi>=0.13.2,<0.14',
39+
'jedi>=0.13.2,<0.15,!=0.14.0',
4040
'python-jsonrpc-server>=0.1.0',
4141
'pluggy'
4242
],

test/plugins/test_completion.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_jedi_completion(config):
4949
items = pyls_jedi_completions(config, doc, com_position)
5050

5151
assert items
52-
assert items[0]['label'] == 'isabs(s)'
52+
assert items[0]['label'] == 'isabs(path)'
5353

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

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

9292

9393
def test_jedi_method_completion(config):

test/plugins/test_definitions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_builtin_definition(config):
3939

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

4444

4545
def test_assignment(config):

test/plugins/test_symbols.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ def test_symbols(config):
2626
config.update({'plugins': {'jedi_symbols': {'all_scopes': False}}})
2727
symbols = pyls_document_symbols(config, doc)
2828

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

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

0 commit comments

Comments
 (0)