1
0
forked from VimPlug/jedi

Use the first item returned by get_names_of_scope

This commit is contained in:
Takafumi Arakaki
2013-03-10 19:29:58 +01:00
parent 06de4d66e7
commit 36f03f4b0d

View File

@@ -375,9 +375,9 @@ def get_definitions(scope):
:type scope: Scope
:rtype: list of Definition
"""
tuples = evaluate.get_names_of_scope(
scope, star_search=False, include_builtin=False)
names = reduce(lambda x, y: x + y[1], tuples, [])
pair = next(evaluate.get_names_of_scope(
scope, star_search=False, include_builtin=False), None)
names = pair[1] if pair else []
return [Definition(d) for d in sorted(names, key=lambda s: s.start_pos)]