mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Actually use follow_builtin_imports and improve the goto docstring, fixes #1492
This commit is contained in:
@@ -271,12 +271,12 @@ class Script(object):
|
|||||||
"""
|
"""
|
||||||
Return the first definition found, while optionally following imports.
|
Return the first definition found, while optionally following imports.
|
||||||
Multiple objects may be returned, because Python itself is a
|
Multiple objects may be returned, because Python itself is a
|
||||||
dynamic language, which means depending on an option you can have two
|
dynamic language, which means you can have two different versions of a
|
||||||
different versions of a function.
|
function.
|
||||||
|
|
||||||
:param follow_imports: The goto call will follow imports.
|
:param follow_imports: The goto call will follow imports.
|
||||||
:param follow_builtin_imports: If follow_imports is True will decide if
|
:param follow_builtin_imports: If follow_imports is True will try to
|
||||||
it follow builtin imports.
|
look up names in builtins (i.e. compiled or extension modules).
|
||||||
:param only_stubs: Only return stubs for this goto call.
|
:param only_stubs: Only return stubs for this goto call.
|
||||||
:param prefer_stubs: Prefer stubs to Python objects for this goto call.
|
:param prefer_stubs: Prefer stubs to Python objects for this goto call.
|
||||||
:rtype: list of :class:`classes.Definition`
|
:rtype: list of :class:`classes.Definition`
|
||||||
@@ -310,7 +310,7 @@ class Script(object):
|
|||||||
names = list(name.goto())
|
names = list(name.goto())
|
||||||
|
|
||||||
if follow_imports:
|
if follow_imports:
|
||||||
names = helpers.filter_follow_imports(names)
|
names = helpers.filter_follow_imports(names, follow_builtin_imports)
|
||||||
names = convert_names(
|
names = convert_names(
|
||||||
names,
|
names,
|
||||||
only_stubs=only_stubs,
|
only_stubs=only_stubs,
|
||||||
|
|||||||
Reference in New Issue
Block a user