From 516b58b287e99779db19981cb1c4bd2421fd2223 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 18 Mar 2020 10:16:32 +0100 Subject: [PATCH] Fix a lot of sphinx warnings --- docs/docs/api-classes.rst | 8 +++++++- docs/docs/features.rst | 2 +- jedi/api/__init__.py | 4 ++-- jedi/api/classes.py | 7 ++++--- jedi/api/environment.py | 2 +- jedi/api/project.py | 2 +- jedi/inference/docstrings.py | 4 ++-- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/docs/docs/api-classes.rst b/docs/docs/api-classes.rst index 9a0cfc75..681a312b 100644 --- a/docs/docs/api-classes.rst +++ b/docs/docs/api-classes.rst @@ -30,11 +30,17 @@ BaseSignature :show-inheritance: Signature -~~~~~~~~~~ +~~~~~~~~~ .. autoclass:: jedi.api.classes.Signature :members: :show-inheritance: +ParamName +~~~~~~~~~ +.. autoclass:: jedi.api.classes.ParamName + :members: + :show-inheritance: + Refactoring ~~~~~~~~~~~ diff --git a/docs/docs/features.rst b/docs/docs/features.rst index 13b8165b..8de4bdcd 100644 --- a/docs/docs/features.rst +++ b/docs/docs/features.rst @@ -75,7 +75,7 @@ Caveats 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 -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 ``PySide``, ``wx``, ``tensorflow``, ``pandas``, etc. diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index 36919409..c322de81 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -114,7 +114,7 @@ class Script(object): ``code``, if it is not a ``unicode`` object (default ``'utf-8'``). :type encoding: str :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 ` to work with a specific Python version or virtualenv. :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`. :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 returned by :func:`globals` and :func:`locals`. """ diff --git a/jedi/api/classes.py b/jedi/api/classes.py index 8ae9296f..5224a156 100644 --- a/jedi/api/classes.py +++ b/jedi/api/classes.py @@ -6,6 +6,7 @@ There are a couple of classes documented in here: - :class:`.Completion` for completions - :class:`.BaseSignature` as a base class for signatures - :class:`.Signature` for :meth:`.Script.get_signatures` only +- :class:`.ParamName` used for parameters of signatures - :class:`.Refactoring` for refactorings - :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 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_builtin_imports: If follow_imports is True will try to @@ -650,7 +651,7 @@ class Completion(BaseName): @property 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:: def foo(param=0): @@ -787,7 +788,7 @@ class BaseSignature(Name): Returns definitions for all parameters that a signature defines. This includes stuff like ``*args`` and ``**kwargs``. - :rtype: list of :class:`ParamName` + :rtype: list of :class:`.ParamName` """ return [ParamName(self._inference_state, n) for n in self._signature.get_param_names(resolve_stars=True)] diff --git a/jedi/api/environment.py b/jedi/api/environment.py index a523756d..3ab2bf80 100644 --- a/jedi/api/environment.py +++ b/jedi/api/environment.py @@ -362,7 +362,7 @@ def create_environment(path, safe=True): Virtualenv path or an executable path. :raises: :exc:`.InvalidPythonEnvironment` - :returns: :class:`Environment` + :returns: :class:`.Environment` """ if os.path.isfile(path): _assert_safe(path, safe) diff --git a/jedi/api/project.py b/jedi/api/project.py index c424a160..f60fd29f 100644 --- a/jedi/api/project.py +++ b/jedi/api/project.py @@ -2,7 +2,7 @@ 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 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 be used across repositories. diff --git a/jedi/inference/docstrings.py b/jedi/inference/docstrings.py index 62f07e99..5f0941e8 100644 --- a/jedi/inference/docstrings.py +++ b/jedi/inference/docstrings.py @@ -1,7 +1,7 @@ """ Docstrings are another source of information for functions and classes. -:mod:`jedi.inference.dynamic` tries to find all executions of functions, while -the docstring parsing is much easier. There are three different types of +:mod:`jedi.inference.dynamic_params` tries to find all executions of functions, +while the docstring parsing is much easier. There are three different types of docstrings that |jedi| understands: - `Sphinx `_