Fixed an issue with error nodes and completion in more complex settings.

This commit is contained in:
Dave Halter
2016-07-11 17:32:00 +02:00
parent b1fbc512d8
commit e18c8200dd
2 changed files with 8 additions and 1 deletions

View File

@@ -102,7 +102,12 @@ def call_of_leaf(leaf, cut_own_trailer=False):
power.children[cut:] = []
if power.type == 'error_node':
transformed = tree.Node('power', power.children)
start = index
while True:
start -= 1
if power.children[start].type != 'trailer':
break
transformed = tree.Node('power', power.children[start:])
transformed.parent = power.parent
return transformed

View File

@@ -49,6 +49,8 @@ def scope_nested():
#? float()
import_tree.pkg.mod1.a
#? ['a', '__name__', '__package__', '__file__', '__doc__']
a = import_tree.pkg.mod1.
import import_tree.random
#? set