mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-20 23:08:26 +08:00
sphinx: update api return types
This commit is contained in:
18
jedi/api.py
18
jedi/api.py
@@ -47,7 +47,7 @@ class Script(object):
|
|||||||
it hasn't been saved yet.
|
it hasn't been saved yet.
|
||||||
:type source_path: string or None
|
:type source_path: string or None
|
||||||
:param source_encoding: The encoding of ``source``, if it is not a
|
:param source_encoding: The encoding of ``source``, if it is not a
|
||||||
``unicode`` object (default `utf-8`).
|
``unicode`` object (default ``'utf-8'``).
|
||||||
:type source_encoding: string
|
:type source_encoding: string
|
||||||
"""
|
"""
|
||||||
def __init__(self, source, line, column, source_path,
|
def __init__(self, source, line, column, source_path,
|
||||||
@@ -71,9 +71,8 @@ class Script(object):
|
|||||||
Return :class:`api_classes.Completion` objects. Those objects contain
|
Return :class:`api_classes.Completion` objects. Those objects contain
|
||||||
information about the completions, more than just names.
|
information about the completions, more than just names.
|
||||||
|
|
||||||
:return: list of :class:`api_classes.Completion` objects, sorted by
|
:return: completion objects, sorted by name and __ comes last.
|
||||||
name and __ comes last.
|
:rtype: list of :class:`api_classes.Completion`
|
||||||
:rtype: list
|
|
||||||
"""
|
"""
|
||||||
def follow_imports_if_possible(name):
|
def follow_imports_if_possible(name):
|
||||||
# TODO remove this, or move to another place (not used)
|
# TODO remove this, or move to another place (not used)
|
||||||
@@ -210,9 +209,7 @@ class Script(object):
|
|||||||
a dynamic language, which means depending on an option you can have two
|
a dynamic language, which means depending on an option you can have two
|
||||||
different versions of a function.
|
different versions of a function.
|
||||||
|
|
||||||
:return: list of :class:`api_classes.Definition` objects, which are
|
:rtype: list of :class:`api_classes.Definition`
|
||||||
basically scopes.
|
|
||||||
:rtype: list
|
|
||||||
"""
|
"""
|
||||||
def resolve_import_paths(scopes):
|
def resolve_import_paths(scopes):
|
||||||
for s in scopes.copy():
|
for s in scopes.copy():
|
||||||
@@ -248,8 +245,7 @@ class Script(object):
|
|||||||
itself is a dynamic language, which means depending on an option you
|
itself is a dynamic language, which means depending on an option you
|
||||||
can have two different versions of a function.
|
can have two different versions of a function.
|
||||||
|
|
||||||
:return: list of :class:`api_classes.Definition` objects, which are
|
:rtype: list of :class:`api_classes.Definition`
|
||||||
basically scopes.
|
|
||||||
"""
|
"""
|
||||||
d = [api_classes.Definition(d) for d in set(self._goto()[0])]
|
d = [api_classes.Definition(d) for d in set(self._goto()[0])]
|
||||||
return sorted(d, key=lambda x: (x.module_path, x.start_pos))
|
return sorted(d, key=lambda x: (x.module_path, x.start_pos))
|
||||||
@@ -312,6 +308,8 @@ class Script(object):
|
|||||||
variable.
|
variable.
|
||||||
|
|
||||||
.. todo:: Implement additional_module_paths
|
.. todo:: Implement additional_module_paths
|
||||||
|
|
||||||
|
:rtype: list of :class:`api_classes.RelatedName`
|
||||||
"""
|
"""
|
||||||
user_stmt = self._parser.user_stmt
|
user_stmt = self._parser.user_stmt
|
||||||
definitions, search_name = self._goto(add_import_name=True)
|
definitions, search_name = self._goto(add_import_name=True)
|
||||||
@@ -351,6 +349,8 @@ class Script(object):
|
|||||||
>>> abs()# <-- cursor is here
|
>>> abs()# <-- cursor is here
|
||||||
|
|
||||||
This would return ``None``.
|
This would return ``None``.
|
||||||
|
|
||||||
|
:rtype: :class:`api_classes.CallDef`
|
||||||
"""
|
"""
|
||||||
def check_user_stmt(user_stmt):
|
def check_user_stmt(user_stmt):
|
||||||
if user_stmt is None \
|
if user_stmt is None \
|
||||||
|
|||||||
Reference in New Issue
Block a user