mirror of
https://github.com/davidhalter/jedi.git
synced 2026-03-01 19:26:49 +08:00
get_related_names:statements should work for now
This commit is contained in:
@@ -145,7 +145,7 @@ def dec(func):
|
|||||||
|
|
||||||
|
|
||||||
def _scan_array(arr, search_name):
|
def _scan_array(arr, search_name):
|
||||||
""" Returns the function Call that match func_name in an Array. """
|
""" Returns the function Call that match search_name in an Array. """
|
||||||
result = []
|
result = []
|
||||||
for sub in arr:
|
for sub in arr:
|
||||||
for s in sub:
|
for s in sub:
|
||||||
@@ -324,7 +324,12 @@ def get_related_names(definitions, search_name, modules):
|
|||||||
names = []
|
names = []
|
||||||
for d in definitions:
|
for d in definitions:
|
||||||
if isinstance(d, parsing.Statement):
|
if isinstance(d, parsing.Statement):
|
||||||
pass
|
for op, arr in d.assignment_details:
|
||||||
|
calls = _scan_array(arr, search_name)
|
||||||
|
for call in calls:
|
||||||
|
for n in call.name.names:
|
||||||
|
if n == search_name:
|
||||||
|
names.append(RelatedName(n, d.parent()))
|
||||||
else:
|
else:
|
||||||
names.append(RelatedName(d.name.names[0], d))
|
names.append(RelatedName(d.name.names[0], d))
|
||||||
|
|
||||||
|
|||||||
@@ -10,3 +10,14 @@ def abc(): pass
|
|||||||
abc.d.a.abc.d
|
abc.d.a.abc.d
|
||||||
|
|
||||||
abc
|
abc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
abc =
|
||||||
|
|
||||||
|
#< abc@20,0 abc@23,0
|
||||||
|
abc
|
||||||
|
|||||||
Reference in New Issue
Block a user