Fix a lot of sphinx warnings

This commit is contained in:
Dave Halter
2020-03-18 10:16:32 +01:00
parent e53acb4150
commit 516b58b287
7 changed files with 18 additions and 11 deletions

View File

@@ -30,11 +30,17 @@ BaseSignature
:show-inheritance: :show-inheritance:
Signature Signature
~~~~~~~~~~ ~~~~~~~~~
.. autoclass:: jedi.api.classes.Signature .. autoclass:: jedi.api.classes.Signature
:members: :members:
:show-inheritance: :show-inheritance:
ParamName
~~~~~~~~~
.. autoclass:: jedi.api.classes.ParamName
:members:
:show-inheritance:
Refactoring Refactoring
~~~~~~~~~~~ ~~~~~~~~~~~

View File

@@ -75,7 +75,7 @@ Caveats
Importing ``numpy`` can be quite slow sometimes, as well as loading the Importing ``numpy`` can be quite slow sometimes, as well as loading the
builtins the first time. If you want to speed things up, you could preload builtins the first time. If you want to speed things up, you could preload
libriaries in |jedi|, with :func:`preload_module`. However, once loaded, this libriaries in |jedi|, with :func:`.preload_module`. However, once loaded, this
should not be a problem anymore. The same is true for huge modules like should not be a problem anymore. The same is true for huge modules like
``PySide``, ``wx``, ``tensorflow``, ``pandas``, etc. ``PySide``, ``wx``, ``tensorflow``, ``pandas``, etc.

View File

@@ -114,7 +114,7 @@ class Script(object):
``code``, if it is not a ``unicode`` object (default ``'utf-8'``). ``code``, if it is not a ``unicode`` object (default ``'utf-8'``).
:type encoding: str :type encoding: str
:param sys_path: Deprecated, use the project parameter. :param sys_path: Deprecated, use the project parameter.
:type sys_path: list of str :type sys_path: typing.List[str]
:param Environment environment: Provide a predefined :ref:`Environment <environments>` :param Environment environment: Provide a predefined :ref:`Environment <environments>`
to work with a specific Python version or virtualenv. to work with a specific Python version or virtualenv.
:param Project project: Provide a :class:`.Project` to make sure finding :param Project project: Provide a :class:`.Project` to make sure finding
@@ -799,7 +799,7 @@ class Interpreter(Script):
All keyword arguments are same as the arguments for :class:`.Script`. All keyword arguments are same as the arguments for :class:`.Script`.
:param str code: Code to parse. :param str code: Code to parse.
:type namespaces: list of dict :type namespaces: typing.List[dict]
:param namespaces: A list of namespace dictionaries such as the one :param namespaces: A list of namespace dictionaries such as the one
returned by :func:`globals` and :func:`locals`. returned by :func:`globals` and :func:`locals`.
""" """

View File

@@ -6,6 +6,7 @@ There are a couple of classes documented in here:
- :class:`.Completion` for completions - :class:`.Completion` for completions
- :class:`.BaseSignature` as a base class for signatures - :class:`.BaseSignature` as a base class for signatures
- :class:`.Signature` for :meth:`.Script.get_signatures` only - :class:`.Signature` for :meth:`.Script.get_signatures` only
- :class:`.ParamName` used for parameters of signatures
- :class:`.Refactoring` for refactorings - :class:`.Refactoring` for refactorings
- :class:`.SyntaxError` for :meth:`.Script.get_syntax_errors` only - :class:`.SyntaxError` for :meth:`.Script.get_syntax_errors` only
@@ -389,7 +390,7 @@ class BaseName(object):
""" """
Like :meth:`.Script.goto` (also supports the same params), but does it Like :meth:`.Script.goto` (also supports the same params), but does it
for the current name. This is typically useful if you are using for the current name. This is typically useful if you are using
something like :meth:`Script.get_names()`. something like :meth:`.Script.get_names()`.
: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 try to :param follow_builtin_imports: If follow_imports is True will try to
@@ -650,7 +651,7 @@ class Completion(BaseName):
@property @property
def name_with_symbols(self): def name_with_symbols(self):
""" """
Similar to :attr:`name`, but like :attr:`name` returns also the Similar to :attr:`.name`, but like :attr:`.name` returns also the
symbols, for example assuming the following function definition:: symbols, for example assuming the following function definition::
def foo(param=0): def foo(param=0):
@@ -787,7 +788,7 @@ class BaseSignature(Name):
Returns definitions for all parameters that a signature defines. Returns definitions for all parameters that a signature defines.
This includes stuff like ``*args`` and ``**kwargs``. This includes stuff like ``*args`` and ``**kwargs``.
:rtype: list of :class:`ParamName` :rtype: list of :class:`.ParamName`
""" """
return [ParamName(self._inference_state, n) return [ParamName(self._inference_state, n)
for n in self._signature.get_param_names(resolve_stars=True)] for n in self._signature.get_param_names(resolve_stars=True)]

View File

@@ -362,7 +362,7 @@ def create_environment(path, safe=True):
Virtualenv path or an executable path. Virtualenv path or an executable path.
:raises: :exc:`.InvalidPythonEnvironment` :raises: :exc:`.InvalidPythonEnvironment`
:returns: :class:`Environment` :returns: :class:`.Environment`
""" """
if os.path.isfile(path): if os.path.isfile(path):
_assert_safe(path, safe) _assert_safe(path, safe)

View File

@@ -2,7 +2,7 @@
Projects are a way to handle Python projects within Jedi. For simpler plugins Projects are a way to handle Python projects within Jedi. For simpler plugins
you might not want to deal with projects, but if you want to give the user more you might not want to deal with projects, but if you want to give the user more
flexibility to define sys paths and Python interpreters for a project, flexibility to define sys paths and Python interpreters for a project,
:class:`Project` is the perfect way to allow for that. :class:`.Project` is the perfect way to allow for that.
Projects can be saved to disk and loaded again, to allow project definitions to Projects can be saved to disk and loaded again, to allow project definitions to
be used across repositories. be used across repositories.

View File

@@ -1,7 +1,7 @@
""" """
Docstrings are another source of information for functions and classes. Docstrings are another source of information for functions and classes.
:mod:`jedi.inference.dynamic` tries to find all executions of functions, while :mod:`jedi.inference.dynamic_params` tries to find all executions of functions,
the docstring parsing is much easier. There are three different types of while the docstring parsing is much easier. There are three different types of
docstrings that |jedi| understands: docstrings that |jedi| understands:
- `Sphinx <http://sphinx-doc.org/markup/desc.html#info-field-lists>`_ - `Sphinx <http://sphinx-doc.org/markup/desc.html#info-field-lists>`_