mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Rework a lot of the README
This commit is contained in:
60
README.rst
60
README.rst
@@ -1,6 +1,6 @@
|
|||||||
###################################################################
|
####################################################################################
|
||||||
Jedi - an awesome autocompletion/static analysis library for Python
|
Jedi - an awesome autocompletion, static analysis and refactoring library for Python
|
||||||
###################################################################
|
####################################################################################
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/v/jedi.svg?style=flat
|
.. image:: https://img.shields.io/pypi/v/jedi.svg?style=flat
|
||||||
:target: https://pypi.python.org/pypi/jedi
|
:target: https://pypi.python.org/pypi/jedi
|
||||||
@@ -23,10 +23,6 @@ Jedi - an awesome autocompletion/static analysis library for Python
|
|||||||
:alt: Coverage status
|
:alt: Coverage status
|
||||||
|
|
||||||
|
|
||||||
*If you have specific questions, please add an issue or ask on* `Stack Overflow
|
|
||||||
<https://stackoverflow.com/questions/tagged/python-jedi>`_ *with the label* ``python-jedi``.
|
|
||||||
|
|
||||||
|
|
||||||
Jedi is a static analysis tool for Python that can be used in IDEs/editors.
|
Jedi is a static analysis tool for Python that can be used in IDEs/editors.
|
||||||
Jedi has a focus on autocompletion and goto functionality. Jedi is fast and is
|
Jedi has a focus on autocompletion and goto functionality. Jedi is fast and is
|
||||||
very well tested. It understands Python and stubs on a deep level.
|
very well tested. It understands Python and stubs on a deep level.
|
||||||
@@ -87,31 +83,28 @@ If you want to stay up-to-date (News / RFCs), please subscribe to this `github
|
|||||||
thread <https://github.com/davidhalter/jedi/issues/1063>`_.:
|
thread <https://github.com/davidhalter/jedi/issues/1063>`_.:
|
||||||
|
|
||||||
|
|
||||||
|
Questions
|
||||||
|
=========
|
||||||
|
|
||||||
|
If you have specific questions, please add an issue or ask on `Stack Overflow
|
||||||
|
<https://stackoverflow.com/questions/tagged/python-jedi>`_ with the label ``python-jedi``.
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
============
|
============
|
||||||
|
|
||||||
pip install jedi
|
`Check out the docs <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.
|
|
||||||
|
|
||||||
You don't want to use ``pip``? Please refer to the `manual
|
|
||||||
<https://jedi.readthedocs.org/en/latest/docs/installation.html>`_.
|
|
||||||
|
|
||||||
|
|
||||||
Features and Limitations
|
Features and Limitations
|
||||||
========================
|
========================
|
||||||
|
|
||||||
Jedi really understands your Python code. For a comprehensive list what Jedi
|
Jedi's features are listed here:
|
||||||
understands, see: `Features
|
`Features <https://jedi.readthedocs.org/en/latest/docs/features.html>`_.
|
||||||
<https://jedi.readthedocs.org/en/latest/docs/features.html>`_. A list of
|
|
||||||
caveats can be found on the same page.
|
|
||||||
|
|
||||||
You can run Jedi on CPython 2.7 or 3.5+ but it should also
|
You can run Jedi on CPython 2.7 or 3.5+ but it should also
|
||||||
understand/parse code older than those versions. Additionally you should be able
|
understand code that is older than those versions. Additionally you should be
|
||||||
to use `Virtualenvs <https://jedi.readthedocs.org/en/latest/docs/api.html#environments>`_
|
able to use `Virtualenvs <https://jedi.readthedocs.org/en/latest/docs/api.html#environments>`_
|
||||||
very well.
|
very well.
|
||||||
|
|
||||||
Tips on how to use Jedi efficiently can be found `here
|
Tips on how to use Jedi efficiently can be found `here
|
||||||
@@ -120,19 +113,23 @@ Tips on how to use Jedi efficiently can be found `here
|
|||||||
API
|
API
|
||||||
---
|
---
|
||||||
|
|
||||||
You can find the documentation for the `API here <https://jedi.readthedocs.org/en/latest/docs/api.html>`_.
|
You can find a comprehensive documentation for the
|
||||||
|
`API here <https://jedi.readthedocs.org/en/latest/docs/api.html>`_.
|
||||||
|
|
||||||
|
Autocompletion / Goto / Documentation
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
Autocompletion / Goto / Pydoc
|
There are the following commands:
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
Please check the API for a good explanation. There are the following commands:
|
|
||||||
|
|
||||||
- ``jedi.Script.goto``
|
- ``jedi.Script.goto``
|
||||||
|
- ``jedi.Script.infer``
|
||||||
|
- ``jedi.Script.help``
|
||||||
- ``jedi.Script.complete``
|
- ``jedi.Script.complete``
|
||||||
- ``jedi.Script.get_references``
|
- ``jedi.Script.get_references``
|
||||||
|
- ``jedi.Script.get_signatures``
|
||||||
|
- ``jedi.Script.get_context``
|
||||||
|
|
||||||
The returned objects are very powerful and really all you might need.
|
The returned objects are very powerful and are really all you might need.
|
||||||
|
|
||||||
|
|
||||||
Autocompletion in your REPL (IPython, etc.)
|
Autocompletion in your REPL (IPython, etc.)
|
||||||
@@ -149,9 +146,9 @@ This means that in Python you can enable tab completion in a `REPL
|
|||||||
Static Analysis
|
Static Analysis
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
To do all forms of static analysis, please try to use
|
For a lot of forms of static analysis, you can try to use
|
||||||
``jedi.Script(...).get_names``. It will return a list of names that you can use
|
``jedi.Script(...).get_names``. It will return a list of names that you can
|
||||||
to infer types and so on. There is also a way to list the syntax errors in a
|
then filter and work with. There is also a way to list the syntax errors in a
|
||||||
file: ``jedi.Script.get_syntax_errors``.
|
file: ``jedi.Script.get_syntax_errors``.
|
||||||
|
|
||||||
|
|
||||||
@@ -171,7 +168,8 @@ Code Search
|
|||||||
There is support for module search with ``jedi.Script.search``, and project
|
There is support for module search with ``jedi.Script.search``, and project
|
||||||
search for ``jedi.Project.search``. The way to search is either by providing a
|
search for ``jedi.Project.search``. The way to search is either by providing a
|
||||||
name like ``foo`` or by using dotted syntax like ``foo.bar``. Additionally you
|
name like ``foo`` or by using dotted syntax like ``foo.bar``. Additionally you
|
||||||
can provide the API type like ``class foo.bar.Bar``.
|
can provide the API type like ``class foo.bar.Bar``. There are also the
|
||||||
|
functions ``jedi.Script.complete_search`` and ``jedi.Project.complete_search``.
|
||||||
|
|
||||||
Development
|
Development
|
||||||
===========
|
===========
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
.. include global.rst
|
.. include global.rst
|
||||||
|
|
||||||
Jedi - an awesome autocompletion/static analysis library for Python
|
Jedi - an awesome autocompletion, static analysis and refactoring library for Python
|
||||||
===================================================================
|
====================================================================================
|
||||||
|
|
||||||
Release v\ |release|. (:doc:`Installation <docs/installation>`)
|
Release v\ |release|. (:doc:`Installation <docs/installation>`)
|
||||||
|
|
||||||
.. automodule:: jedi
|
.. automodule:: jedi
|
||||||
|
|
||||||
Autocompletion can look like this (e.g. VIM plugin):
|
Autocompletion can for example look like this in jedi-vim:
|
||||||
|
|
||||||
.. figure:: _screenshots/screenshot_complete.png
|
.. figure:: _screenshots/screenshot_complete.png
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user