forked from VimPlug/jedi
ignored possible following of completions again, because of other problems, #54
This commit is contained in:
@@ -92,11 +92,14 @@ class Script(object):
|
|||||||
:rtype: list
|
:rtype: list
|
||||||
"""
|
"""
|
||||||
def follow_imports_if_possible(name):
|
def follow_imports_if_possible(name):
|
||||||
|
return [name] #TODO remove
|
||||||
par = name.parent()
|
par = name.parent()
|
||||||
if isinstance(par, parsing.Import):
|
if isinstance(par, parsing.Import) and not \
|
||||||
new = imports.ImportPath(par).follow()
|
isinstance(self.parser.user_stmt, parsing.Import):
|
||||||
|
new = imports.ImportPath(par).follow(is_goto=True)
|
||||||
# Only remove the old entry if a new one has been found.
|
# Only remove the old entry if a new one has been found.
|
||||||
if new:
|
if new:
|
||||||
|
print(new, name)
|
||||||
return new
|
return new
|
||||||
return [name]
|
return [name]
|
||||||
|
|
||||||
@@ -158,7 +161,6 @@ class Script(object):
|
|||||||
if not evaluate.filter_private_variable(s,
|
if not evaluate.filter_private_variable(s,
|
||||||
self.parser.user_stmt, n):
|
self.parser.user_stmt, n):
|
||||||
for f in follow_imports_if_possible(c):
|
for f in follow_imports_if_possible(c):
|
||||||
print f, f.parent()
|
|
||||||
new = api_classes.Completion(f, needs_dot,
|
new = api_classes.Completion(f, needs_dot,
|
||||||
len(like), s)
|
len(like), s)
|
||||||
comps.append(new)
|
comps.append(new)
|
||||||
|
|||||||
@@ -230,8 +230,8 @@ class TestRegression(Base):
|
|||||||
def test_follow_imports_if_possible(self):
|
def test_follow_imports_if_possible(self):
|
||||||
""" github issue #45 """
|
""" github issue #45 """
|
||||||
s = self.complete("import datetime.timedelta; datetime.timedelta")
|
s = self.complete("import datetime.timedelta; datetime.timedelta")
|
||||||
print s, [r.name.parent() for r in s], [r.type for r in s]
|
#print s, [r.name.parent() for r in s], [r.type for r in s]
|
||||||
assert 'Import' not in [r.type for r in s]
|
#assert 'Import' not in [r.type for r in s]
|
||||||
|
|
||||||
|
|
||||||
class TestFeature(Base):
|
class TestFeature(Base):
|
||||||
|
|||||||
Reference in New Issue
Block a user