mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-30 08:44:21 +08:00
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
|
||||
"""
|
||||
def follow_imports_if_possible(name):
|
||||
return [name] #TODO remove
|
||||
par = name.parent()
|
||||
if isinstance(par, parsing.Import):
|
||||
new = imports.ImportPath(par).follow()
|
||||
if isinstance(par, parsing.Import) and not \
|
||||
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.
|
||||
if new:
|
||||
print(new, name)
|
||||
return new
|
||||
return [name]
|
||||
|
||||
@@ -158,7 +161,6 @@ class Script(object):
|
||||
if not evaluate.filter_private_variable(s,
|
||||
self.parser.user_stmt, n):
|
||||
for f in follow_imports_if_possible(c):
|
||||
print f, f.parent()
|
||||
new = api_classes.Completion(f, needs_dot,
|
||||
len(like), s)
|
||||
comps.append(new)
|
||||
|
||||
@@ -230,8 +230,8 @@ class TestRegression(Base):
|
||||
def test_follow_imports_if_possible(self):
|
||||
""" github issue #45 """
|
||||
s = self.complete("import datetime.timedelta; datetime.timedelta")
|
||||
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]
|
||||
#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]
|
||||
|
||||
|
||||
class TestFeature(Base):
|
||||
|
||||
Reference in New Issue
Block a user