mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Docs: Restructure API overview
This commit is contained in:
@@ -3,26 +3,10 @@
|
|||||||
API Overview
|
API Overview
|
||||||
============
|
============
|
||||||
|
|
||||||
.. currentmodule:: jedi
|
.. note:: This documentation is mostly for Plugin developers, who want to
|
||||||
|
improve their editors/IDE with Jedi.
|
||||||
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 ``import jedi``. You then have
|
|
||||||
direct access to the :class:`.Script`. You can then call the functions
|
|
||||||
documented here. These functions return :ref:`API classes
|
|
||||||
<api-classes>`.
|
|
||||||
|
|
||||||
|
|
||||||
Deprecations
|
|
||||||
------------
|
|
||||||
|
|
||||||
The deprecation process is as follows:
|
|
||||||
|
|
||||||
1. A deprecation is announced in the next major/minor release.
|
|
||||||
2. We wait either at least a year & at least two minor releases until we remove
|
|
||||||
the deprecated functionality.
|
|
||||||
|
|
||||||
|
.. _api:
|
||||||
|
|
||||||
API Documentation
|
API Documentation
|
||||||
-----------------
|
-----------------
|
||||||
@@ -35,20 +19,34 @@ The API consists of a few different parts:
|
|||||||
- :ref:`Python Versions/Virtualenv Support <environments>` with functions like
|
- :ref:`Python Versions/Virtualenv Support <environments>` with functions like
|
||||||
:func:`.find_system_environments` and :func:`.find_virtualenvs`
|
:func:`.find_system_environments` and :func:`.find_virtualenvs`
|
||||||
|
|
||||||
.. _api:
|
Script
|
||||||
|
~~~~~~
|
||||||
Static Analysis Interface
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
.. automodule:: jedi
|
|
||||||
|
|
||||||
.. autoclass:: jedi.Script
|
.. autoclass:: jedi.Script
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
Interpreter
|
||||||
|
~~~~~~~~~~~
|
||||||
.. autoclass:: jedi.Interpreter
|
.. autoclass:: jedi.Interpreter
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
Helper Functions
|
||||||
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. autofunction:: jedi.preload_module
|
.. autofunction:: jedi.preload_module
|
||||||
.. autofunction:: jedi.set_debug_function
|
.. autofunction:: jedi.set_debug_function
|
||||||
|
|
||||||
|
.. _projects:
|
||||||
|
|
||||||
|
Projects
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
.. automodule:: jedi.api.project
|
||||||
|
|
||||||
|
.. autofunction:: jedi.get_default_project
|
||||||
|
.. autoclass:: jedi.Project
|
||||||
|
:members:
|
||||||
|
|
||||||
.. _environments:
|
.. _environments:
|
||||||
|
|
||||||
Environments
|
Environments
|
||||||
@@ -65,6 +63,12 @@ Environments
|
|||||||
.. autoclass:: jedi.api.environment.Environment
|
.. autoclass:: jedi.api.environment.Environment
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
Errors
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
.. autoexception:: jedi.InternalError
|
||||||
|
.. autoexception:: jedi.RefactoringError
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@@ -127,3 +131,12 @@ References:
|
|||||||
5
|
5
|
||||||
>>> rns[0].column
|
>>> rns[0].column
|
||||||
8
|
8
|
||||||
|
|
||||||
|
Deprecations
|
||||||
|
------------
|
||||||
|
|
||||||
|
The deprecation process is as follows:
|
||||||
|
|
||||||
|
1. A deprecation is announced in the next major/minor release.
|
||||||
|
2. We wait either at least a year & at least two minor releases until we remove
|
||||||
|
the deprecated functionality.
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ from jedi.api.environment import find_virtualenvs, find_system_environments, \
|
|||||||
get_system_environment, InterpreterEnvironment
|
get_system_environment, InterpreterEnvironment
|
||||||
from jedi.api.project import Project, get_default_project
|
from jedi.api.project import Project, get_default_project
|
||||||
from jedi.api.exceptions import InternalError, RefactoringError
|
from jedi.api.exceptions import InternalError, RefactoringError
|
||||||
|
|
||||||
# Finally load the internal plugins. This is only internal.
|
# Finally load the internal plugins. This is only internal.
|
||||||
from jedi.plugins import registry
|
from jedi.plugins import registry
|
||||||
del registry
|
del registry
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
"""
|
||||||
|
Projects
|
||||||
|
"""
|
||||||
import os
|
import os
|
||||||
import errno
|
import errno
|
||||||
import json
|
import json
|
||||||
@@ -56,6 +59,9 @@ def _force_unicode_list(lst):
|
|||||||
|
|
||||||
|
|
||||||
class Project(object):
|
class Project(object):
|
||||||
|
"""
|
||||||
|
XXX
|
||||||
|
"""
|
||||||
_environment = None
|
_environment = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -199,7 +205,9 @@ class Project(object):
|
|||||||
|
|
||||||
def complete_search(self, string, **kwargs):
|
def complete_search(self, string, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
XXX
|
||||||
|
|
||||||
|
:yields: :class:`.Completion`
|
||||||
"""
|
"""
|
||||||
return self._search_func(string, complete=True, **kwargs)
|
return self._search_func(string, complete=True, **kwargs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user