diff --git a/docs/conf.py b/docs/conf.py index 2211d253..84d8fb57 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,7 +28,7 @@ sys.path.insert(0, os.path.abspath('..')) # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.todo', 'sphinx.ext.intersphinx', 'sphinx.ext.inheritance_diagram', - 'sphinx_rtd_theme'] + 'sphinx_rtd_theme', 'sphinx.ext.autosummary'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/docs/api.rst b/docs/docs/api.rst index cfff9fb8..3171ab32 100644 --- a/docs/docs/api.rst +++ b/docs/docs/api.rst @@ -19,6 +19,32 @@ The API consists of a few different parts: - A way to work with different :ref:`Folders / Projects ` - Helpful functions: :func:`.preload_module` and :func:`.set_debug_function` +The methods that you are most likely going to use to work with Jedi are the +following ones: + +.. currentmodule:: jedi + +.. autosummary:: + :nosignatures: + + Script.complete + Script.goto + Script.infer + Script.help + Script.get_signatures + Script.get_references + Script.get_context + Script.get_names + Script.get_syntax_errors + Script.rename + Script.inline + Script.extract_variable + Script.extract_function + Script.search + Script.complete_search + Project.search + Project.complete_search + Script ------ diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index f12372f1..36919409 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -260,7 +260,7 @@ class Script(object): @validate_line_column def complete(self, line=None, column=None, **kwargs): """ - Return :class:`.Completion` objects. + Completes objects under the cursor. Those objects contain information about the completions, more than just names. @@ -428,9 +428,9 @@ class Script(object): def complete_search(self, string, **kwargs): """ - Like :meth:`.Script.search`, but returns completions for the current - string. If you want to have all possible definitions in a file you can - also provide an empty string. + Like :meth:`.Script.search`, but completes that string. If you want to + have all possible definitions in a file you can also provide an empty + string. :param bool all_scopes: Default False; searches not only for definitions on the top level of a module level, but also in @@ -653,8 +653,7 @@ class Script(object): @_no_python2_support def rename(self, line=None, column=None, **kwargs): """ - Returns an object that you can use to rename the variable under the - cursor and its references to a different name. + Renames all references of the variable under the cursor. :param new_name: The variable under the cursor will be renamed to this string. @@ -671,7 +670,8 @@ class Script(object): @validate_line_column def extract_variable(self, line=None, column=None, **kwargs): """ - Moves an expression of a selected range to a new statemenet. + Moves an expression to a new statemenet. + For example if you have the cursor on ``foo`` and provide a ``new_name`` called ``bar``:: @@ -712,7 +712,8 @@ class Script(object): @_no_python2_support def extract_function(self, line, column, **kwargs): """ - Moves an expression of a selected range to a new function. + Moves an expression to a new function. + For example if you have the cursor on ``foo`` and provide a ``new_name`` called ``bar``:: diff --git a/jedi/api/project.py b/jedi/api/project.py index a7d99c43..c424a160 100644 --- a/jedi/api/project.py +++ b/jedi/api/project.py @@ -236,9 +236,8 @@ class Project(object): def complete_search(self, string, **kwargs): """ - Like :meth:`.Project.search`, but returns completions for the current - string. An empty string lists all definitions in a project, so be - careful with that. + Like :meth:`.Script.search`, but completes that string. An empty string + lists all definitions in a project, so be careful with that. :param bool all_scopes: Default False; searches not only for definitions on the top level of a module level, but also in