From 9e17f552f1d3643a49a9f37dca90e56aab03869d Mon Sep 17 00:00:00 2001
From: Takafumi Arakaki
Date: Sat, 29 Dec 2012 20:27:52 +0100
Subject: [PATCH 01/17] Move comments in settings.py to docstring
---
docs/source/plugin-api.rst | 5 ++
jedi/settings.py | 129 ++++++++++++++++++++++++-------------
2 files changed, 89 insertions(+), 45 deletions(-)
diff --git a/docs/source/plugin-api.rst b/docs/source/plugin-api.rst
index 58d42994..eb8b1d71 100644
--- a/docs/source/plugin-api.rst
+++ b/docs/source/plugin-api.rst
@@ -25,6 +25,11 @@ API Return Classes
.. automodule:: api_classes
:undoc-members:
+Jedi setting interface
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. automodule:: settings
+
Examples
--------
diff --git a/jedi/settings.py b/jedi/settings.py
index b976d866..8c5c7bd8 100644
--- a/jedi/settings.py
+++ b/jedi/settings.py
@@ -2,58 +2,84 @@
# completion output settings
# ----------------
-# The completion is by default case insensitive.
case_insensitive_completion = True
+"""
+The completion is by default case insensitive.
+"""
-# Adds a dot after a module, because a module that is not accessed this way is
-# definitely not the normal case. However, in VIM this doesn't work, that's why
-# it isn't used at the moment.
add_dot_after_module = False
+"""
+Adds a dot after a module, because a module that is not accessed this way is
+definitely not the normal case. However, in VIM this doesn't work, that's why
+it isn't used at the moment.
+"""
-# Adds an opening bracket after a function, because that's normal behaviour.
-# Removed it again, because in VIM that is not very practical.
add_bracket_after_function = False
+"""
+Adds an opening bracket after a function, because that's normal behaviour.
+Removed it again, because in VIM that is not very practical.
+"""
-# If set, completions with the same name don't appear in the output anymore,
-# but are in the `same_name_completions` attribute.
no_completion_duplicates = True
+"""
+If set, completions with the same name don't appear in the output anymore,
+but are in the `same_name_completions` attribute.
+"""
# ----------------
# parser
# ----------------
-# Use the fast parser. This means that reparsing is only being done if
-# something has been changed e.g. to a function. If this happens, only the
-# function is being reparsed.
fast_parser = True
+"""
+Use the fast parser. This means that reparsing is only being done if
+something has been changed e.g. to a function. If this happens, only the
+function is being reparsed.
+"""
-# This is just a debugging option. Always reparsing means that the fast parser
-# is basically useless. So don't use it.
fast_parser_always_reparse = False
+"""
+This is just a debugging option. Always reparsing means that the fast parser
+is basically useless. So don't use it.
+"""
-# Use the cache (full cache) to generate get_in_function_call's. This may fail
-# with multiline docstrings (likely) and other complicated changes (unlikely).
-# The goal is to move away from it by making the rest faster.
use_get_in_function_call_cache = True
+"""
+Use the cache (full cache) to generate get_in_function_call's. This may fail
+with multiline docstrings (likely) and other complicated changes (unlikely).
+The goal is to move away from it by making the rest faster.
+"""
# ----------------
# dynamic stuff
# ----------------
-# check for `append`, etc. on array instances like list()
dynamic_arrays_instances = True
-# check for `append`, etc. on arrays: [], {}, ()
+"""
+check for `append`, etc. on array instances like list()
+"""
+
dynamic_array_additions = True
+"""
+check for `append`, etc. on arrays: [], {}, ()
+"""
-# A dynamic param completion, finds the callees of the function, which define
-# the params of a function.
dynamic_params = True
-# Do the same for other modules.
-dynamic_params_for_other_modules = True
+"""
+A dynamic param completion, finds the callees of the function, which define
+the params of a function.
+"""
+
+dynamic_params_for_other_modules = True
+"""
+Do the same for other modules.
+"""
-# Additional modules in which Jedi checks if statements are to be found. This
-# is practical for IDE's, that want to administrate their modules themselves.
additional_dynamic_modules = []
+"""
+Additional modules in which Jedi checks if statements are to be found. This
+is practical for IDE's, that want to administrate their modules themselves.
+"""
# ----------------
# recursions
@@ -64,49 +90,62 @@ additional_dynamic_modules = []
# `max_executions`. This limit is important, to set a maximum amount of time,
# the completion may use.
#
-# The `max_until_execution_unique` limit is probably the most important one,
-# because if that limit is passed, functions can only be one time executed. So
-# new functions will be executed, complex recursions with the same functions
-# again and again, are ignored.
-#
-# `max_function_recursion_level` is more about whether the recursions are
-# stopped in deepth or in width. The ratio beetween this and
-# `max_until_execution_unique` is important here. It stops a recursion (after
-# the number of function calls in the recursion), if it was already used
-# earlier.
-#
# The values are based on my experimental tries, used on the jedi library. But
# I don't think there's any other Python library, that uses recursion in a
# similar (extreme) way. This makes the completion definitely worse in some
# cases. But a completion should also be fast.
-max_function_recursion_level = 5
max_until_execution_unique = 50
+"""
+The `max_until_execution_unique` limit is probably the most important one,
+because if that limit is passed, functions can only be one time executed. So
+new functions will be executed, complex recursions with the same functions
+again and again, are ignored.
+"""
+
+max_function_recursion_level = 5
+"""
+`max_function_recursion_level` is more about whether the recursions are
+stopped in deepth or in width. The ratio beetween this and
+`max_until_execution_unique` is important here. It stops a recursion (after
+the number of function calls in the recursion), if it was already used
+earlier.
+"""
+
max_executions_without_builtins = 200
+
max_executions = 250
-# Because get_in_function_call is normally used on every single key hit, it has
-# to be faster than a normal completion. This is the factor that is used to
-# scale `max_executions` and `max_until_execution_unique`:
scale_get_in_function_call = 0.1
+"""
+Because get_in_function_call is normally used on every single key hit, it has
+to be faster than a normal completion. This is the factor that is used to
+scale `max_executions` and `max_until_execution_unique`:
+"""
# ----------------
# various
# ----------------
-# Size of the current code part, which is used to speed up parsing.
part_line_length = 20
+"""
+Size of the current code part, which is used to speed up parsing.
+"""
# ----------------
# caching validity (time)
# ----------------
-# In huge packages like numpy, checking all star imports on every completion
-# might be slow, therefore we do a star import caching, that lasts a certain
-# time span (in seconds).
star_import_cache_validity = 60.0
+"""
+In huge packages like numpy, checking all star imports on every completion
+might be slow, therefore we do a star import caching, that lasts a certain
+time span (in seconds).
+"""
-# Finding function calls might be slow (0.1-0.5s). This is not acceptible for
-# normal writing. Therefore cache it for a short time.
get_in_function_call_validity = 3.0
+"""
+Finding function calls might be slow (0.1-0.5s). This is not acceptible for
+normal writing. Therefore cache it for a short time.
+"""
From 0747469ffcd35815e5148d0c9c47285c0e71408b Mon Sep 17 00:00:00 2001
From: Takafumi Arakaki
Date: Sat, 29 Dec 2012 20:28:57 +0100
Subject: [PATCH 02/17] Use autodoc_member_order = 'bysource'
This is for making the variables appear in settings.py
to appear in the document in the same order.
---
docs/source/conf.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 13529c36..44b6f95a 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -256,4 +256,5 @@ todo_include_todos = False
# -- Options for autodoc module ------------------------------------------------
+autodoc_member_order = 'bysource'
autodoc_default_flags = ['members', 'undoc-members']
From c11a4fc050e0a866d5f57a30678b7b217422bd1d Mon Sep 17 00:00:00 2001
From: Takafumi Arakaki
Date: Sat, 29 Dec 2012 20:36:29 +0100
Subject: [PATCH 03/17] Add top level docstring to settings.py
---
jedi/settings.py | 61 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 51 insertions(+), 10 deletions(-)
diff --git a/jedi/settings.py b/jedi/settings.py
index 8c5c7bd8..197d46b5 100644
--- a/jedi/settings.py
+++ b/jedi/settings.py
@@ -1,3 +1,54 @@
+"""
+* Completion output settings
+
+ - :data:`case_insensitive_completion`
+ - :data:`add_dot_after_module`
+ - :data:`add_bracket_after_function`
+ - :data:`no_completion_duplicates`
+
+* Parser
+
+ - :data:`fast_parser`
+ - :data:`fast_parser_always_reparse`
+ - :data:`use_get_in_function_call_cache`
+
+* Dynamic stuff
+
+ - :data:`dynamic_arrays_instances`
+ - :data:`dynamic_array_additions`
+ - :data:`dynamic_params`
+ - :data:`dynamic_params_for_other_modules`
+ - :data:`additional_dynamic_modules`
+
+* Recursions
+
+ Recursion settings are important if you don't want extremly
+ recursive python code to go absolutely crazy. First of there is a
+ global limit :data:`max_executions`. This limit is important, to set
+ a maximum amount of time, the completion may use.
+
+ The values are based on my experimental tries, used on the jedi library. But
+ I don't think there's any other Python library, that uses recursion in a
+ similar (extreme) way. This makes the completion definitely worse in some
+ cases. But a completion should also be fast.
+
+ - :data:`max_until_execution_unique`
+ - :data:`max_function_recursion_level`
+ - :data:`max_executions_without_builtins`
+ - :data:`max_executions`
+ - :data:`scale_get_in_function_call`
+
+* Various
+
+ - :data:`part_line_length`
+
+* Caching validity (time)
+
+ - :data:`star_import_cache_validity`
+ - :data:`get_in_function_call_validity`
+
+"""
+
# ----------------
# completion output settings
# ----------------
@@ -85,16 +136,6 @@ is practical for IDE's, that want to administrate their modules themselves.
# recursions
# ----------------
-# Recursion settings are important if you don't want extremly recursive python
-# code to go absolutely crazy. First of there is a global limit
-# `max_executions`. This limit is important, to set a maximum amount of time,
-# the completion may use.
-#
-# The values are based on my experimental tries, used on the jedi library. But
-# I don't think there's any other Python library, that uses recursion in a
-# similar (extreme) way. This makes the completion definitely worse in some
-# cases. But a completion should also be fast.
-
max_until_execution_unique = 50
"""
The `max_until_execution_unique` limit is probably the most important one,
From 51b22e0cb50908071b19dd770fbf82129a7e6d83 Mon Sep 17 00:00:00 2001
From: Takafumi Arakaki
Date: Sat, 29 Dec 2012 20:39:08 +0100
Subject: [PATCH 04/17] Add docstrings to all variables in settings.py
---
jedi/settings.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/jedi/settings.py b/jedi/settings.py
index 197d46b5..bee03669 100644
--- a/jedi/settings.py
+++ b/jedi/settings.py
@@ -154,8 +154,14 @@ earlier.
"""
max_executions_without_builtins = 200
+"""
+.. todo:: Document this.
+"""
max_executions = 250
+"""
+A maximum amount of time, the completion may use.
+"""
scale_get_in_function_call = 0.1
"""
From d89f469e12b070d7d62944db89021a0aa3887a88 Mon Sep 17 00:00:00 2001
From: Takafumi Arakaki
Date: Sat, 29 Dec 2012 20:48:46 +0100
Subject: [PATCH 05/17] Add intro part in settings.py
---
jedi/settings.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/jedi/settings.py b/jedi/settings.py
index bee03669..d4c4716c 100644
--- a/jedi/settings.py
+++ b/jedi/settings.py
@@ -1,4 +1,13 @@
"""
+Variables to hold global jedi setting.
+
+Plugin can change the variables defined in :mod:`jedi.settings` to
+modify behavior of Jedi. Plugin should expose an interface to setup
+these variables by user. Example usage::
+
+ from jedi import settings
+ settings.case_insensitive_completion = True
+
* Completion output settings
- :data:`case_insensitive_completion`
From 7210751584606bfbcf6ef8793dd8938f983e6813 Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 00:29:08 +0100
Subject: [PATCH 06/17] Switched to flask theme
---
docs/source/_themes/flask/LICENSE | 37 ++
docs/source/_themes/flask/layout.html | 25 ++
docs/source/_themes/flask/relations.html | 19 +
docs/source/_themes/flask/static/flasky.css_t | 395 ++++++++++++++++++
.../_themes/flask/static/small_flask.css | 70 ++++
docs/source/_themes/flask/theme.conf | 9 +
docs/source/_themes/flask_theme_support.py | 125 ++++++
docs/source/conf.py | 7 +-
8 files changed, 684 insertions(+), 3 deletions(-)
create mode 100644 docs/source/_themes/flask/LICENSE
create mode 100644 docs/source/_themes/flask/layout.html
create mode 100644 docs/source/_themes/flask/relations.html
create mode 100644 docs/source/_themes/flask/static/flasky.css_t
create mode 100644 docs/source/_themes/flask/static/small_flask.css
create mode 100644 docs/source/_themes/flask/theme.conf
create mode 100644 docs/source/_themes/flask_theme_support.py
diff --git a/docs/source/_themes/flask/LICENSE b/docs/source/_themes/flask/LICENSE
new file mode 100644
index 00000000..8daab7ee
--- /dev/null
+++ b/docs/source/_themes/flask/LICENSE
@@ -0,0 +1,37 @@
+Copyright (c) 2010 by Armin Ronacher.
+
+Some rights reserved.
+
+Redistribution and use in source and binary forms of the theme, with or
+without modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+* The names of the contributors may not be used to endorse or
+ promote products derived from this software without specific
+ prior written permission.
+
+We kindly ask you to only use these themes in an unmodified manner just
+for Flask and Flask-related products, not for unrelated projects. If you
+like the visual style and want to use it for your own projects, please
+consider making some larger changes to the themes (such as changing
+font faces, sizes, colors or margins).
+
+THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/docs/source/_themes/flask/layout.html b/docs/source/_themes/flask/layout.html
new file mode 100644
index 00000000..5caa4e29
--- /dev/null
+++ b/docs/source/_themes/flask/layout.html
@@ -0,0 +1,25 @@
+{%- extends "basic/layout.html" %}
+{%- block extrahead %}
+ {{ super() }}
+ {% if theme_touch_icon %}
+
+ {% endif %}
+
+{% endblock %}
+{%- block relbar2 %}{% endblock %}
+{% block header %}
+ {{ super() }}
+ {% if pagename == 'index' %}
+
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 2cabc4a4..deb779dd 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -141,7 +141,7 @@ html_static_path = ['_static']
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',
- 'sourcelink.html', 'searchbox.html']
+ 'ghbuttons.html', 'sourcelink.html', 'searchbox.html']
}
# Additional templates that should be rendered to pages, maps page names to
From beba40e920b29243fbbd72c8b8bea50ef79c54f0 Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 01:44:50 +0100
Subject: [PATCH 10/17] Dynamically update copyright date range
---
docs/source/conf.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index deb779dd..b06cf7bb 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -11,7 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys, os, datetime
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -43,7 +43,7 @@ master_doc = 'index'
# General information about the project.
project = u'Jedi'
-copyright = u'2012, Jedi contributors'
+copyright = u'2012 - {today.year}, Jedi contributors'.format(today=datetime.date.today())
_path = os.path.dirname(os.path.abspath(__file__))
with open(_path + '/../../VERSION') as f:
From a2151717502a08441e354639c6b10da9a3be35b2 Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 01:45:12 +0100
Subject: [PATCH 11/17] Improved docs
---
docs/source/_themes/flask/static/flasky.css_t | 1 -
docs/source/index.rst | 40 +++++++++++--------
docs/source/plugin-api.rst | 3 +-
jedi/__init__.py | 15 ++++---
4 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/docs/source/_themes/flask/static/flasky.css_t b/docs/source/_themes/flask/static/flasky.css_t
index b5ca39bc..79ab4787 100644
--- a/docs/source/_themes/flask/static/flasky.css_t
+++ b/docs/source/_themes/flask/static/flasky.css_t
@@ -185,7 +185,6 @@ a.headerlink {
a.headerlink:hover {
color: #444;
- background: #eaeaea;
}
div.body p, div.body dd, div.body li {
diff --git a/docs/source/index.rst b/docs/source/index.rst
index d12298a0..4d79d3cb 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,9 +1,7 @@
-Jedi – Python autocompletion that works!
-========================================
+Jedi
+====
-
-About Jedi
-----------
+Release v\ |version|. (:doc:`Installation `)
.. automodule:: jedi
:members:
@@ -12,10 +10,10 @@ About Jedi
Autocompletion can look like this (e.g. VIM plugin):
.. figure:: screenshot_complete.png
- :align: center
-Contents
---------
+
+Docs
+----
.. toctree::
:maxdepth: 1
@@ -23,16 +21,24 @@ Contents
installation
plugin-api
+
Resources
---------
-- `Source Code on github `_
-- `Travis testing `_
-- `Current PyPi package `_
-Plugins using the Jedi library
-------------------------------
+- `Source Code on Github `_
+- `Travis Testing `_
+- `Python Package Index `_
-- `VIM-Plugin `_
-- `Emacs-Plugin `_
-- `Sublime-Plugin `_ **Under construction**
-- `wdb (web debugger) `_
+
+Text Editor Plugins
+-------------------
+
+- `Vim `_
+- `Emacs `_
+- `Sublime Text 2 `_ (*under construction*)
+
+
+Other Software Using Jedi
+-------------------------
+
+- `wdb `_
diff --git a/docs/source/plugin-api.rst b/docs/source/plugin-api.rst
index eb8b1d71..f5bc1aa2 100644
--- a/docs/source/plugin-api.rst
+++ b/docs/source/plugin-api.rst
@@ -1,4 +1,4 @@
-The plugin API
+The Plugin API
==============
.. currentmodule:: jedi
@@ -19,6 +19,7 @@ API Interface
.. automodule:: api
:undoc-members:
+
API Return Classes
~~~~~~~~~~~~~~~~~~
diff --git a/jedi/__init__.py b/jedi/__init__.py
index a9e4a2f8..a25554e9 100644
--- a/jedi/__init__.py
+++ b/jedi/__init__.py
@@ -1,10 +1,10 @@
"""
-Jedi is an autocompletion library for Python. It offers additonal
-services such as goto / get_definition / pydoc support /
-get_in_function_call / related names.
+Jedi is an autocompletion library for Python. It offers additional services
+such as goto / get_definition / pydoc support / get_in_function_call / related
+names.
-To give you a simple exmple how you can use the jedi library,
-here is an exmple for the autocompletion feature:
+To give you a simple example how you can use the jedi library, here is an
+example for the autocompletion feature:
>>> import jedi
>>> source = '''import json; json.l'''
@@ -19,9 +19,8 @@ here is an exmple for the autocompletion feature:
>>> completions[0].word
'load'
-As you see Jedi is pretty simple and allows you to concentrate
-writing a good text editor, while still having very good IDE features
-for Python.
+As you see Jedi is pretty simple and allows you to concentrate writing a good
+text editor, while still having very good IDE features for Python.
"""
import sys
From e01a6cd0f8546e35aca1acd69dd98d1ac20bb78f Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 01:59:43 +0100
Subject: [PATCH 12/17] Changed directory structure
---
.gitignore | 2 +-
README.rst | 6 +++---
docs/Makefile | 6 +++---
.../screenshot_complete.png | Bin
.../screenshot_function.png | Bin
docs/{source => _screenshots}/screenshot_pydoc.png | Bin
docs/{source => }/_static/logo.png | Bin
docs/{source => }/_templates/ghbuttons.html | 0
docs/{source => }/_templates/sidebarlogo.html | 0
docs/{source => }/_themes/flask/LICENSE | 0
docs/{source => }/_themes/flask/layout.html | 0
docs/{source => }/_themes/flask/relations.html | 0
docs/{source => }/_themes/flask/static/flasky.css_t | 0
.../_themes/flask/static/small_flask.css | 0
docs/{source => }/_themes/flask/theme.conf | 0
docs/{source => }/_themes/flask_theme_support.py | 0
docs/{source => }/conf.py | 6 +++---
docs/{source => docs}/installation.rst | 0
docs/{source => docs}/plugin-api.rst | 0
docs/{source => }/index.rst | 8 ++++----
20 files changed, 14 insertions(+), 14 deletions(-)
rename docs/{source => _screenshots}/screenshot_complete.png (100%)
rename docs/{source => _screenshots}/screenshot_function.png (100%)
rename docs/{source => _screenshots}/screenshot_pydoc.png (100%)
rename docs/{source => }/_static/logo.png (100%)
rename docs/{source => }/_templates/ghbuttons.html (100%)
rename docs/{source => }/_templates/sidebarlogo.html (100%)
rename docs/{source => }/_themes/flask/LICENSE (100%)
rename docs/{source => }/_themes/flask/layout.html (100%)
rename docs/{source => }/_themes/flask/relations.html (100%)
rename docs/{source => }/_themes/flask/static/flasky.css_t (100%)
rename docs/{source => }/_themes/flask/static/small_flask.css (100%)
rename docs/{source => }/_themes/flask/theme.conf (100%)
rename docs/{source => }/_themes/flask_theme_support.py (100%)
rename docs/{source => }/conf.py (98%)
rename docs/{source => docs}/installation.rst (100%)
rename docs/{source => docs}/plugin-api.rst (100%)
rename docs/{source => }/index.rst (81%)
diff --git a/.gitignore b/.gitignore
index 6a44ebf4..1f303fe4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,6 @@
.ropeproject
*.pyc
/build/
-/docs/build/
+/docs/_build/
/dist/
jedi.egg-info/
diff --git a/README.rst b/README.rst
index b00267a0..1acd8513 100644
--- a/README.rst
+++ b/README.rst
@@ -29,15 +29,15 @@ Jedi for now, you'll have to use VIM. But there are new plugins emerging:
Here are some pictures:
-.. image:: https://github.com/davidhalter/jedi/raw/master/docs/source/screenshot_complete.png
+.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png
Completion for almost anything (Ctrl+Space).
-.. image:: https://github.com/davidhalter/jedi/raw/master/docs/source/screenshot_function.png
+.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png
Display of function/class bodies, docstrings.
-.. image:: https://github.com/davidhalter/jedi/raw/master/docs/source/screenshot_pydoc.png
+.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png
Pydoc support (with highlighting, Shift+k).
diff --git a/docs/Makefile b/docs/Makefile
index 62c5845a..14cfdf4b 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -5,14 +5,14 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
-BUILDDIR = build
+BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
diff --git a/docs/source/screenshot_complete.png b/docs/_screenshots/screenshot_complete.png
similarity index 100%
rename from docs/source/screenshot_complete.png
rename to docs/_screenshots/screenshot_complete.png
diff --git a/docs/source/screenshot_function.png b/docs/_screenshots/screenshot_function.png
similarity index 100%
rename from docs/source/screenshot_function.png
rename to docs/_screenshots/screenshot_function.png
diff --git a/docs/source/screenshot_pydoc.png b/docs/_screenshots/screenshot_pydoc.png
similarity index 100%
rename from docs/source/screenshot_pydoc.png
rename to docs/_screenshots/screenshot_pydoc.png
diff --git a/docs/source/_static/logo.png b/docs/_static/logo.png
similarity index 100%
rename from docs/source/_static/logo.png
rename to docs/_static/logo.png
diff --git a/docs/source/_templates/ghbuttons.html b/docs/_templates/ghbuttons.html
similarity index 100%
rename from docs/source/_templates/ghbuttons.html
rename to docs/_templates/ghbuttons.html
diff --git a/docs/source/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html
similarity index 100%
rename from docs/source/_templates/sidebarlogo.html
rename to docs/_templates/sidebarlogo.html
diff --git a/docs/source/_themes/flask/LICENSE b/docs/_themes/flask/LICENSE
similarity index 100%
rename from docs/source/_themes/flask/LICENSE
rename to docs/_themes/flask/LICENSE
diff --git a/docs/source/_themes/flask/layout.html b/docs/_themes/flask/layout.html
similarity index 100%
rename from docs/source/_themes/flask/layout.html
rename to docs/_themes/flask/layout.html
diff --git a/docs/source/_themes/flask/relations.html b/docs/_themes/flask/relations.html
similarity index 100%
rename from docs/source/_themes/flask/relations.html
rename to docs/_themes/flask/relations.html
diff --git a/docs/source/_themes/flask/static/flasky.css_t b/docs/_themes/flask/static/flasky.css_t
similarity index 100%
rename from docs/source/_themes/flask/static/flasky.css_t
rename to docs/_themes/flask/static/flasky.css_t
diff --git a/docs/source/_themes/flask/static/small_flask.css b/docs/_themes/flask/static/small_flask.css
similarity index 100%
rename from docs/source/_themes/flask/static/small_flask.css
rename to docs/_themes/flask/static/small_flask.css
diff --git a/docs/source/_themes/flask/theme.conf b/docs/_themes/flask/theme.conf
similarity index 100%
rename from docs/source/_themes/flask/theme.conf
rename to docs/_themes/flask/theme.conf
diff --git a/docs/source/_themes/flask_theme_support.py b/docs/_themes/flask_theme_support.py
similarity index 100%
rename from docs/source/_themes/flask_theme_support.py
rename to docs/_themes/flask_theme_support.py
diff --git a/docs/source/conf.py b/docs/conf.py
similarity index 98%
rename from docs/source/conf.py
rename to docs/conf.py
index b06cf7bb..614ecef1 100644
--- a/docs/source/conf.py
+++ b/docs/conf.py
@@ -16,8 +16,8 @@ import sys, os, datetime
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('../..'))
-sys.path.insert(0, os.path.abspath('../../jedi'))
+sys.path.insert(0, os.path.abspath('..'))
+sys.path.insert(0, os.path.abspath('../jedi'))
sys.path.append(os.path.abspath('_themes'))
# -- General configuration -----------------------------------------------------
@@ -46,7 +46,7 @@ project = u'Jedi'
copyright = u'2012 - {today.year}, Jedi contributors'.format(today=datetime.date.today())
_path = os.path.dirname(os.path.abspath(__file__))
-with open(_path + '/../../VERSION') as f:
+with open(os.path.join(_path, '../VERSION'), 'r') as f:
VERSION = f.read().strip()
# The version info for the project you're documenting, acts as replacement for
diff --git a/docs/source/installation.rst b/docs/docs/installation.rst
similarity index 100%
rename from docs/source/installation.rst
rename to docs/docs/installation.rst
diff --git a/docs/source/plugin-api.rst b/docs/docs/plugin-api.rst
similarity index 100%
rename from docs/source/plugin-api.rst
rename to docs/docs/plugin-api.rst
diff --git a/docs/source/index.rst b/docs/index.rst
similarity index 81%
rename from docs/source/index.rst
rename to docs/index.rst
index 4d79d3cb..69194e69 100644
--- a/docs/source/index.rst
+++ b/docs/index.rst
@@ -1,7 +1,7 @@
Jedi
====
-Release v\ |version|. (:doc:`Installation `)
+Release v\ |release|. (:doc:`Installation `)
.. automodule:: jedi
:members:
@@ -9,7 +9,7 @@ Release v\ |version|. (:doc:`Installation `)
Autocompletion can look like this (e.g. VIM plugin):
-.. figure:: screenshot_complete.png
+.. figure:: _screenshots/screenshot_complete.png
Docs
@@ -18,8 +18,8 @@ Docs
.. toctree::
:maxdepth: 1
- installation
- plugin-api
+ docs/installation
+ docs/plugin-api
Resources
From e9ca801f0fd1c2fa44a1e531927d8a91ff4cadf1 Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 02:57:35 +0100
Subject: [PATCH 13/17] Added features to documentation
---
docs/docs/features.rst | 94 ++++++++++++++++++++++++++++++++++++++++++
docs/index.rst | 1 +
2 files changed, 95 insertions(+)
create mode 100644 docs/docs/features.rst
diff --git a/docs/docs/features.rst b/docs/docs/features.rst
new file mode 100644
index 00000000..02489cd7
--- /dev/null
+++ b/docs/docs/features.rst
@@ -0,0 +1,94 @@
+Features and Caveats
+====================
+
+Jedi supports many of the widely used Python features:
+
+
+General Features
+----------------
+
+- python 2.5+ and 3.2+ support
+- ignores syntax errors and wrong indentation
+- can deal with complex module / function / class structures
+- virtualenv support
+- can infer function arguments from sphinx and epydoc docstrings
+
+
+Supported Python Features
+-------------------------
+
+- builtins
+- multiple returns or yields
+- tuple assignments / array indexing / dictionary indexing
+- with-statement / exception handling
+- ``*args`` / ``**kwargs``
+- decorators / lambdas / closures
+- generators / iterators
+- some descriptors: property / staticmethod / classmethod
+- some magic methods: ``__call__``, ``__iter__``, ``__next__``, ``__get__``,
+ ``__getitem__``, ``__init__``
+- ``list.append()``, ``set.add()``, ``list.extend()``, etc.
+- (nested) list comprehensions / ternary expressions
+- relative imports
+- ``getattr()`` / ``__getattr__`` / ``__getattribute__``
+- function annotations (py3k feature, are ignored right now, but being parsed.
+ I don't know what to do with them.)
+- class decorators (py3k feature, are being ignored too, until I find a use
+ case, that doesn't work with Jedi)
+- simple/usual ``sys.path`` modifications
+- ``isinstance`` checks for if/while/assert
+
+
+Unsupported Features
+--------------------
+
+Not yet implemented:
+
+- manipulations of instances outside the instance variables without using
+ methods
+
+Will probably never be implemented:
+
+- metaclasses (how could an auto-completion ever support this)
+- ``setattr()``, ``__import__()``
+- writing to some dicts: ``globals()``, ``locals()``, ``object.__dict__``
+- evaluating ``if`` / ``while``
+
+
+Caveats
+-------
+
+**Malformed Syntax**
+
+Syntax errors and other strange stuff may lead to undefined behaviour of the
+completion. Jedi is **NOT** a Python compiler, that tries to correct you. It is
+a tool that wants to help you. But **YOU** have to know Python, not Jedi.
+
+**Legacy Python 2 Features**
+
+This framework should work for both Python 2/3. However, some things were just
+not as *pythonic* in Python 2 as things should be. To keep things simple, some
+older Python 2 features have been left out:
+
+- Classes: Always Python 3 like, therefore all classes inherit from ``object``.
+- Generators: No ``next()`` method. The ``__next__()`` method is used instead.
+- Exceptions are only looked at in the form of ``Exception as e``, no comma!
+
+**Slow Performance**
+
+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 write import hooks in
+jedi, which preload stuff. However, once loaded, this is not a problem anymore.
+The same is true for huge modules like ``PySide``, ``wx``, etc.
+
+**Security**
+
+Security is an important issue for Jedi. Therefore no Python code is executed.
+As long as you write pure python, everything is evaluated statically. But: If
+you use builtin modules (``c_builtin``) there is no other option than to execute
+those modules. However: Execute isn't that critical (as e.g. in pythoncomplete,
+which used to execute *every* import!), because it means one import and no more.
+So basically the only dangerous thing is using the import itself. If your
+``c_builtin`` uses some strange initializations, it might be dangerous. But if
+it does you're screwed anyways, because eventualy you're going to execute your
+code, which executes the import.
diff --git a/docs/index.rst b/docs/index.rst
index 69194e69..d7218f8d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -19,6 +19,7 @@ Docs
:maxdepth: 1
docs/installation
+ docs/features
docs/plugin-api
From 31492a721cfb5b4384329d65c0f5fa72b88f369e Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 02:57:43 +0100
Subject: [PATCH 14/17] Simplified README
---
README.rst | 177 +++--------------------------------------------
jedi/__init__.py | 10 +--
2 files changed, 15 insertions(+), 172 deletions(-)
diff --git a/README.rst b/README.rst
index 1acd8513..9ebc551c 100644
--- a/README.rst
+++ b/README.rst
@@ -47,8 +47,7 @@ Get the latest version from `github `_
(master branch should always be kind of stable/working).
Docs are available at `https://jedi.readthedocs.org/
-`_. Pull requests with documentation
-nhancements
+`_. Pull requests with documentation enhancements
and/or fixes are awesome and most welcome.
Jedi uses `semantic versioning `_ starting with version
@@ -57,100 +56,17 @@ Jedi uses `semantic versioning `_ starting with version
Installation
============
-You can either include Jedi as a submodule in your text editor plugin (like
-jedi-vim_ does it by default), or you
-can install Jedi systemwide.
-
-The preferred way to install the Jedi library into your system is by using
-pip_::
-
- sudo pip install jedi
-
-If you want to install the current development version::
-
- sudo pip install -e git://github.com/davidhalter/jedi.git#egg=jedi
+See https://jedi.readthedocs.org/en/latest/docs/installation.html
Note: This just installs the Jedi library, not the editor plugins. For
information about how to make it work with your editor, refer to the
corresponding documentation.
-Support
-=======
+Feature Support and Caveats
+===========================
-Jedi supports Python 2.5 up to 3.x. There is just one code base, for both
-Python 2 and 3.
-Jedi supports many of the widely used Python features:
-
-- builtin functions/classes support
-- complex module / function / class structures
-- ignores syntax and indentation errors
-- multiple returns / yields
-- tuple assignments / array indexing / dictionary indexing
-- with-statement / exceptions
-- \*args / \*\*kwargs
-- decorators / lambdas / closures
-- descriptors -> property / staticmethod / classmethod
-- generators (yield statement) / iterators
-- support for some magic methods: ``__call__``, ``__iter__``, ``__next__``,
- ``__get__``, ``__getitem__``, ``__init__``
-- support for list.append, set.add, list.extend, etc.
-- (nested) list comprehensions / ternary expressions
-- relative imports
-- ``getattr()`` / ``__getattr__`` / ``__getattribute__``
-- function annotations (py3k feature, are ignored right now, but being parsed.
- I don't know what to do with them.)
-- class decorators (py3k feature, are being ignored too, until I find a use
- case, that doesn't work with Jedi)
-- simple/usual ``sys.path`` modifications
-- ``isinstance`` checks for if/while/assert
-- virtualenv support
-- infer function arguments with sphinx (and other) docstrings
-
-However, it does not yet support (and probably will in future versions, because
-they are on my todo list):
-
-- manipulations of instances outside the instance variables, without using
- functions
-
-It does not support (and most probably will not in future versions):
-
-- metaclasses (how could an auto-completion ever support this)
-- ``setattr()``, ``__import__()``
-- Writing to some dicts: ``globals()``, ``locals()``, ``object.__dict__``
-- evaluate ``if`` / ``while``
-
-
-Caveats
-=======
-
-This framework should work for both Python 2/3. However, some things were just
-not as *pythonic* in Python 2 as things should be. To keep things simple, some
-things have been held back:
-
-- Classes: Always Python 3 like, therefore all classes inherit from ``object``.
-- Generators: No ``next`` method. The ``__next__`` method is used instead.
-- Exceptions are only looked at in the form of ``Exception as e``, no comma!
-
-Syntax errors and other strange stuff, that is defined differently in the
-Python language, may lead to undefined behaviour of the completion. Jedi is
-**NOT** a Python compiler, that tries to correct you. It is a tool that wants
-to help you. But **YOU** have to know Python, not Jedi.
-
-Importing ``numpy`` can be quite slow sometimes, as well as loading the builtins
-the first time. If you want to speed it up, you could write import hooks in
-jedi, which preloads this stuff. However, once loaded, this is not a problem
-anymore. The same is true for huge modules like ``PySide``, ``wx``, etc.
-
-Security is an important issue for Jedi. Therefore no Python code is executed.
-As long as you write pure python, everything is evaluated statically. But: If
-you use builtin modules (`c_builtin`) there is no other option than to execute
-those modules. However: Execute isn't that critical (as e.g. in pythoncomplete,
-which used to execute *every* import!), because it means one import and no
-more. So basically the only dangerous thing is using the import itself. If your
-`c_builtin` uses some strange initializations, it might be dangerous. But if it
-does you're screwed anyways, because eventualy you're going to execute your
-code, which executes the import.
+See https://jedi.readthedocs.org/en/latest/docs/features.html
A little history
@@ -184,82 +100,9 @@ think understanding it might need quite some time, because of its recursive
nature.
-API-Design for IDEs
-===================
+API for IDEs
+============
-If you want to set up an IDE with Jedi, you need to ``import jedi``. You should
-have the following objects available:
-
-::
-
- Script(source, line, column, source_path)
-
-``source`` would be the source of your python file/script, separated by new
-lines. ``line`` is the current line you want to perform actions on (starting
-with line #1 as the first line). ``column`` represents the current
-column/indent of the cursor (starting with zero). ``source_path`` should be the
-path of your file in the file system.
-
-It returns a script object that contains the relevant information for the other
-functions to work without params.
-
-::
-
- Script().complete
-
-Returns ``api.Completion`` objects. Those objects have got
-informations about the completions. More than just names.
-
-::
-
- Script().goto
-
-Similar to complete. The returned ``api.Definition`` objects contain
-information about the definitions found.
-
-::
-
- Script().get_definition
-
-Mostly used for tests. Like goto, but follows statements and imports and
-doesn't break there. You probably don't want to use this function. It's
-mostly for testing.
-
-::
-
- Script().related_names
-
-Returns all names that point to the definition of the name under the
-cursor. This is also very useful for refactoring (renaming).
-
-::
-
- Script().get_in_function_call
-
-Get the ``Function`` object of the call you're currently in, e.g.: ``abs(``
-with the cursor at the end would return the builtin ``abs`` function.
-
-::
-
- NotFoundError
-
-If you use the goto function and no valid identifier (name) is at the
-place of the cursor (position). It will raise this exception.
-
-::
-
- set_debug_function
-
-Sets a callback function for ``debug.py``. This function is called with
-multiple text objects, in python 3 you could insert ``print``.
-
-::
-
- settings
-
-Access to the ``settings.py`` module. The settings are described there.
-
-
-
-.. _jedi-vim: http://github.com/davidhalter/jedi-vim
-.. _pip: http://www.pip-installer.org/
+It's very easy to create an editor plugin that uses Jedi. See
+https://jedi.readthedocs.org/en/latest/docs/plugin-api.html for more
+information.
diff --git a/jedi/__init__.py b/jedi/__init__.py
index a25554e9..d698bbaa 100644
--- a/jedi/__init__.py
+++ b/jedi/__init__.py
@@ -1,7 +1,7 @@
"""
-Jedi is an autocompletion library for Python. It offers additional services
-such as goto / get_definition / pydoc support / get_in_function_call / related
-names.
+Jedi is an autocompletion library for Python. It also offers additional
+services such as goto / get_definition / pydoc support / get_in_function_call /
+related names.
To give you a simple example how you can use the jedi library, here is an
example for the autocompletion feature:
@@ -19,8 +19,8 @@ example for the autocompletion feature:
>>> completions[0].word
'load'
-As you see Jedi is pretty simple and allows you to concentrate writing a good
-text editor, while still having very good IDE features for Python.
+As you see Jedi is pretty simple and allows you to concentrate on writing a
+good text editor, while still having very good IDE features for Python.
"""
import sys
From cd4727ea9cbe72051e349137ea99c05c00966fd8 Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 03:30:56 +0100
Subject: [PATCH 15/17] Added global.rst with jedi macro
---
docs/docs/features.rst | 14 ++++++++------
docs/docs/installation.rst | 30 +++++++++++++++++-------------
docs/docs/plugin-api.rst | 4 +++-
docs/global.rst | 3 +++
docs/index.rst | 14 ++++++++++++--
5 files changed, 43 insertions(+), 22 deletions(-)
create mode 100644 docs/global.rst
diff --git a/docs/docs/features.rst b/docs/docs/features.rst
index 02489cd7..21c34b65 100644
--- a/docs/docs/features.rst
+++ b/docs/docs/features.rst
@@ -1,7 +1,9 @@
+.. include:: ../global.rst
+
Features and Caveats
====================
-Jedi supports many of the widely used Python features:
+|jedi| supports many of the widely used Python features:
General Features
@@ -34,7 +36,7 @@ Supported Python Features
- function annotations (py3k feature, are ignored right now, but being parsed.
I don't know what to do with them.)
- class decorators (py3k feature, are being ignored too, until I find a use
- case, that doesn't work with Jedi)
+ case, that doesn't work with |jedi|)
- simple/usual ``sys.path`` modifications
- ``isinstance`` checks for if/while/assert
@@ -61,8 +63,8 @@ Caveats
**Malformed Syntax**
Syntax errors and other strange stuff may lead to undefined behaviour of the
-completion. Jedi is **NOT** a Python compiler, that tries to correct you. It is
-a tool that wants to help you. But **YOU** have to know Python, not Jedi.
+completion. |jedi| is **NOT** a Python compiler, that tries to correct you. It is
+a tool that wants to help you. But **YOU** have to know Python, not |jedi|.
**Legacy Python 2 Features**
@@ -78,12 +80,12 @@ older Python 2 features have been left out:
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 write import hooks in
-jedi, which preload stuff. However, once loaded, this is not a problem anymore.
+|jedi|, which preload stuff. However, once loaded, this is not a problem anymore.
The same is true for huge modules like ``PySide``, ``wx``, etc.
**Security**
-Security is an important issue for Jedi. Therefore no Python code is executed.
+Security is an important issue for |jedi|. Therefore no Python code is executed.
As long as you write pure python, everything is evaluated statically. But: If
you use builtin modules (``c_builtin``) there is no other option than to execute
those modules. However: Execute isn't that critical (as e.g. in pythoncomplete,
diff --git a/docs/docs/installation.rst b/docs/docs/installation.rst
index c8f0099c..60df49be 100644
--- a/docs/docs/installation.rst
+++ b/docs/docs/installation.rst
@@ -1,31 +1,34 @@
+.. include:: ../global.rst
+
Installation and Configuration
==============================
-You can either include *Jedi* as a submodule in your text editor plugin (like
-jedi-vim_ does it by default), or you can install it systemwide.
+You can either include |jedi| as a submodule in your text editor plugin (like
+jedi-vim_ does by default), or you can install it systemwide.
System-wide installation via a package manager
----------------------------------------------
-You can install *Jedi* directly from pypi using pip::
+You can install |jedi| directly from pypi using pip::
sudo pip install jedi
-If you want to install the current development version::
+If you want to install the current development version (master branch)::
sudo pip install -e git://github.com/davidhalter/jedi.git#egg=jedi
-.. note:: This just installs the Jedi library, not the editor plugins. For
- information about how to make it work with your editor, refer to the
- corresponding documentation.
+.. note:: This just installs the |jedi| library, not the :ref:`editor plugins
+ `. For information about how to make it work with your
+ editor, refer to the corresponding documentation.
Manual installation from a downloaded package
---------------------------------------------
-If you prefer not to use an automated package installer, you can download a
-copy of *Jedi* and install it manually.
+If you prefer not to use an automated package installer, you can `download
+`__ a current copy of
+*Jedi* and install it manually.
To install it, navigate to the directory containing `setup.py` on your console
and type::
@@ -36,10 +39,11 @@ and type::
Inclusion as a submodule
------------------------
-If you use an editor plugin like jedi-vim_, you can simply include *Jedi* as a
-git submodule of the plugin directory. Vim plugin managers like Vundle_ make it
-very easy to keep submodules up to date.
+If you use an editor plugin like jedi-vim_, you can simply include |jedi| as a
+git submodule of the plugin directory. Vim plugin managers like Vundle_ or
+Pathogen_ make it very easy to keep submodules up to date.
.. _jedi-vim: https://github.com/davidhalter/jedi-vim
-.. _Vundle: https://github.com/gmarik/vundle
+.. _vundle: https://github.com/gmarik/vundle
+.. _pathogen: https://github.com/tpope/vim-pathogen
diff --git a/docs/docs/plugin-api.rst b/docs/docs/plugin-api.rst
index f5bc1aa2..3b4e3f40 100644
--- a/docs/docs/plugin-api.rst
+++ b/docs/docs/plugin-api.rst
@@ -1,3 +1,5 @@
+.. include:: ../global.rst
+
The Plugin API
==============
@@ -6,7 +8,7 @@ The Plugin API
Note: This documentation is for Plugin developers, who want to improve their
editors/IDE autocompletion
-If you want to use **Jedi**, you first need to
+If you want to use |jedi|, you first need to
``import jedi``. You then have direct access to the :class:`.Script`.
diff --git a/docs/global.rst b/docs/global.rst
new file mode 100644
index 00000000..0279842a
--- /dev/null
+++ b/docs/global.rst
@@ -0,0 +1,3 @@
+:orphan:
+
+.. |jedi| replace:: *Jedi*
diff --git a/docs/index.rst b/docs/index.rst
index d7218f8d..ca665675 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,3 +1,5 @@
+.. include global.rst
+
Jedi
====
@@ -12,6 +14,8 @@ Autocompletion can look like this (e.g. VIM plugin):
.. figure:: _screenshots/screenshot_complete.png
+.. _toc:
+
Docs
----
@@ -23,6 +27,8 @@ Docs
docs/plugin-api
+.. _resources:
+
Resources
---------
@@ -31,14 +37,18 @@ Resources
- `Python Package Index `_
-Text Editor Plugins
--------------------
+.. _editor-plugins:
+
+Editor Plugins
+--------------
- `Vim `_
- `Emacs `_
- `Sublime Text 2 `_ (*under construction*)
+.. _other-software:
+
Other Software Using Jedi
-------------------------
From a4e1fe47fd6266c358f1c25a03e9dcf3b926c4f5 Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Sun, 30 Dec 2012 04:31:34 +0100
Subject: [PATCH 16/17] Improved plugin api documentation
---
docs/docs/plugin-api.rst | 8 +--
docs/index.rst | 2 -
jedi/api.py | 13 ++---
jedi/api_classes.py | 11 ++--
jedi/settings.py | 107 +++++++++++++++++++++++----------------
5 files changed, 79 insertions(+), 62 deletions(-)
diff --git a/docs/docs/plugin-api.rst b/docs/docs/plugin-api.rst
index 3b4e3f40..62ea23f8 100644
--- a/docs/docs/plugin-api.rst
+++ b/docs/docs/plugin-api.rst
@@ -19,19 +19,19 @@ API Interface
~~~~~~~~~~~~~
.. automodule:: api
- :undoc-members:
API Return Classes
~~~~~~~~~~~~~~~~~~
.. automodule:: api_classes
- :undoc-members:
-Jedi setting interface
-~~~~~~~~~~~~~~~~~~~~~~
+Settings Module
+~~~~~~~~~~~~~~~
.. automodule:: settings
+ :no-members:
+ :no-undoc-members:
Examples
--------
diff --git a/docs/index.rst b/docs/index.rst
index ca665675..8eb83594 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -6,8 +6,6 @@ Jedi
Release v\ |release|. (:doc:`Installation `)
.. automodule:: jedi
- :members:
- :undoc-members:
Autocompletion can look like this (e.g. VIM plugin):
diff --git a/jedi/api.py b/jedi/api.py
index e9534bd7..ab0c8af2 100644
--- a/jedi/api.py
+++ b/jedi/api.py
@@ -1,9 +1,10 @@
"""
-The api basically only provides one class. You can create a :class:`Script` and
-use it's ``complete`` / ``goto`` / etc functions.
+The API basically only provides one class. You can create a :class:`Script` and
+use its methods.
+
Additionally you can add a debug function with :func:`set_debug_function` and
-catch :exc:`NotFoundError` which is being raised if your completion is
-impossible.
+catch :exc:`NotFoundError` which is being raised if your completion is not
+possible.
"""
from __future__ import with_statement
__all__ = ['Script', 'NotFoundError', 'set_debug_function']
@@ -35,7 +36,7 @@ class NotFoundError(Exception):
class Script(object):
"""
A Script is the base for a completion, goto or whatever you want to do with
- jedi.
+ |jedi|.
:param source: The source code of the current file, separated by newlines.
:type source: string
@@ -71,7 +72,7 @@ class Script(object):
Return :class:`api_classes.Completion` objects. Those objects contain
information about the completions, more than just names.
- :return: completion objects, sorted by name and __ comes last.
+ :return: Completion objects, sorted by name and __ comes last.
:rtype: list of :class:`api_classes.Completion`
"""
def follow_imports_if_possible(name):
diff --git a/jedi/api_classes.py b/jedi/api_classes.py
index 64d8a96c..633cf259 100644
--- a/jedi/api_classes.py
+++ b/jedi/api_classes.py
@@ -1,6 +1,7 @@
-"""`api_classes` contains the return classes of the API. These classes are the
-much bigger part of the whole API, because here you get out the information
-about completion and goto operations.
+"""
+The :mod:`api_classes` module contains the return classes of the API. These
+classes are the much bigger part of the whole API, because they contain the
+interesting information about completion and goto operations.
"""
import re
@@ -20,7 +21,7 @@ import keywords
def _clear_caches():
"""
- Clears all caches of this and related modules. The only cache that will not
+ Clear all caches of this and related modules. The only cache that will not
be deleted is the module cache.
"""
cache.clear_caches()
@@ -231,7 +232,7 @@ class Completion(BaseDefinition):
def follow_definition(self):
"""
Return the original definitions. I strongly recommend not using it for
- your completions, because it might slow down *Jedi*. If you want to read
+ your completions, because it might slow down |jedi|. If you want to read
only a few objects (<=20), it might be useful, especially to
get the original docstrings. The basic problem of this function is
that it follows all results. This means with 1000 completions (e.g.
diff --git a/jedi/settings.py b/jedi/settings.py
index d4c4716c..405fd5a4 100644
--- a/jedi/settings.py
+++ b/jedi/settings.py
@@ -1,60 +1,77 @@
"""
-Variables to hold global jedi setting.
+This module contains variables with global |jedi| setting. To change the
+behavior of |jedi|, change the variables defined in
+:mod:`jedi.settings`.
-Plugin can change the variables defined in :mod:`jedi.settings` to
-modify behavior of Jedi. Plugin should expose an interface to setup
-these variables by user. Example usage::
+Plugins should expose an interface so that the user can adjust the
+configuration.
+
+
+Example usage::
from jedi import settings
settings.case_insensitive_completion = True
-* Completion output settings
- - :data:`case_insensitive_completion`
- - :data:`add_dot_after_module`
- - :data:`add_bracket_after_function`
- - :data:`no_completion_duplicates`
+Completion output
+~~~~~~~~~~~~~~~~~
-* Parser
+.. autodata:: case_insensitive_completion
+.. autodata:: add_dot_after_module
+.. autodata:: add_bracket_after_function
+.. autodata:: no_completion_duplicates
- - :data:`fast_parser`
- - :data:`fast_parser_always_reparse`
- - :data:`use_get_in_function_call_cache`
-* Dynamic stuff
+Parser
+~~~~~~
- - :data:`dynamic_arrays_instances`
- - :data:`dynamic_array_additions`
- - :data:`dynamic_params`
- - :data:`dynamic_params_for_other_modules`
- - :data:`additional_dynamic_modules`
+.. autodata:: fast_parser
+.. autodata:: fast_parser_always_reparse
+.. autodata:: use_get_in_function_call_cache
-* Recursions
- Recursion settings are important if you don't want extremly
- recursive python code to go absolutely crazy. First of there is a
- global limit :data:`max_executions`. This limit is important, to set
- a maximum amount of time, the completion may use.
+Dynamic stuff
+~~~~~~~~~~~~~
- The values are based on my experimental tries, used on the jedi library. But
- I don't think there's any other Python library, that uses recursion in a
- similar (extreme) way. This makes the completion definitely worse in some
- cases. But a completion should also be fast.
+.. autodata:: dynamic_arrays_instances
+.. autodata:: dynamic_array_additions
+.. autodata:: dynamic_params
+.. autodata:: dynamic_params_for_other_modules
+.. autodata:: additional_dynamic_modules
- - :data:`max_until_execution_unique`
- - :data:`max_function_recursion_level`
- - :data:`max_executions_without_builtins`
- - :data:`max_executions`
- - :data:`scale_get_in_function_call`
-* Various
+Recursions
+~~~~~~~~~~
- - :data:`part_line_length`
+Recursion settings are important if you don't want extremly
+recursive python code to go absolutely crazy. First of there is a
+global limit :data:`max_executions`. This limit is important, to set
+a maximum amount of time, the completion may use.
-* Caching validity (time)
+The default values are based on experiments while completing the |jedi| library
+itself (inception!). But I don't think there's any other Python library that
+uses recursion in a similarly extreme way. These settings make the completion
+definitely worse in some cases. But a completion should also be fast.
+
+.. autodata:: max_until_execution_unique
+.. autodata:: max_function_recursion_level
+.. autodata:: max_executions_without_builtins
+.. autodata:: max_executions
+.. autodata:: scale_get_in_function_call
+
+
+Caching
+~~~~~~~
+
+.. autodata:: star_import_cache_validity
+.. autodata:: get_in_function_call_validity
+
+
+Various
+~~~~~~~
+
+.. autodata:: part_line_length
- - :data:`star_import_cache_validity`
- - :data:`get_in_function_call_validity`
"""
@@ -116,7 +133,7 @@ The goal is to move away from it by making the rest faster.
dynamic_arrays_instances = True
"""
-check for `append`, etc. on array instances like list()
+Check for `append`, etc. on array instances like list()
"""
dynamic_array_additions = True
@@ -137,8 +154,8 @@ Do the same for other modules.
additional_dynamic_modules = []
"""
-Additional modules in which Jedi checks if statements are to be found. This
-is practical for IDE's, that want to administrate their modules themselves.
+Additional modules in which |jedi| checks if statements are to be found. This
+is practical for IDEs, that want to administrate their modules themselves.
"""
# ----------------
@@ -147,10 +164,10 @@ is practical for IDE's, that want to administrate their modules themselves.
max_until_execution_unique = 50
"""
-The `max_until_execution_unique` limit is probably the most important one,
-because if that limit is passed, functions can only be one time executed. So
-new functions will be executed, complex recursions with the same functions
-again and again, are ignored.
+This limit is probably the most important one, because if this limit is
+exceeded, functions can only be one time executed. So new functions will be
+executed, complex recursions with the same functions again and again, are
+ignored.
"""
max_function_recursion_level = 5
From 96e961a609b5375982649ff64d6096be30a9651e Mon Sep 17 00:00:00 2001
From: Danilo Bargen
Date: Wed, 2 Jan 2013 20:09:17 +0100
Subject: [PATCH 17/17] Disabled sidebar image for now...
---
docs/conf.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index 614ecef1..905c9038 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -140,8 +140,14 @@ html_static_path = ['_static']
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
- '**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',
- 'ghbuttons.html', 'sourcelink.html', 'searchbox.html']
+ '**': [
+# 'sidebarlogo.html',
+ 'localtoc.html',
+ 'relations.html',
+ 'ghbuttons.html',
+ 'sourcelink.html',
+ 'searchbox.html'
+ ]
}
# Additional templates that should be rendered to pages, maps page names to