forked from VimPlug/jedi
none positions shouldn't be an option, (0, 0) is the 'invalid' or 'generated' position for objects that are always found
This commit is contained in:
+5
-1
@@ -949,8 +949,12 @@ def get_defined_names_for_position(scope, position=None, start_scope=None):
|
|||||||
return names
|
return names
|
||||||
names_new = []
|
names_new = []
|
||||||
for n in names:
|
for n in names:
|
||||||
if n.start_pos < position:
|
try:
|
||||||
|
if n.start_pos[0] is not None and n.start_pos < position:
|
||||||
names_new.append(n)
|
names_new.append(n)
|
||||||
|
except:
|
||||||
|
print(n, position, n.parent())
|
||||||
|
raise
|
||||||
return names_new
|
return names_new
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -80,8 +80,8 @@ class ImportPath(parsing.Base):
|
|||||||
"""
|
"""
|
||||||
i = self.import_stmt
|
i = self.import_stmt
|
||||||
# This is not an existing Import statement. Therefore, set position to
|
# This is not an existing Import statement. Therefore, set position to
|
||||||
# None.
|
# 0 (0 is not a valid line number).
|
||||||
zero = (None, None)
|
zero = (0, 0)
|
||||||
n = parsing.Name(i.namespace.names[1:], zero, zero, self.import_stmt)
|
n = parsing.Name(i.namespace.names[1:], zero, zero, self.import_stmt)
|
||||||
new = parsing.Import(zero, zero, n)
|
new = parsing.Import(zero, zero, n)
|
||||||
new.parent = weakref.ref(parent)
|
new.parent = weakref.ref(parent)
|
||||||
|
|||||||
Reference in New Issue
Block a user