mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
additional documentation, affects #28
This commit is contained in:
@@ -17,7 +17,7 @@ sucks less than other tools. It understands almost all of the basic Python
|
||||
syntax elements including many builtins.
|
||||
|
||||
Jedi suports two different goto functions and has support for renaming.
|
||||
Probably it will also have some support for refactoring some in the future.
|
||||
Probably it will also have some support for refactoring in the future.
|
||||
|
||||
Jedi uses a very simple interface to connect with IDE's. As an reference, there
|
||||
is a VIM implementation, which uses Jedi's autocompletion. However, I encourage
|
||||
|
||||
@@ -7,4 +7,10 @@ sys.path.insert(0, __path__[0])
|
||||
from .api import Script, NotFoundError, set_debug_function
|
||||
from . import settings
|
||||
|
||||
from . import api
|
||||
|
||||
__doc__ = api.__doc__
|
||||
|
||||
del api
|
||||
|
||||
sys.path.pop(0)
|
||||
|
||||
25
jedi/api.py
25
jedi/api.py
@@ -1,3 +1,28 @@
|
||||
"""
|
||||
Jedi is an autocompletion library for Python. It offers additonal
|
||||
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:
|
||||
|
||||
>>> import jedi
|
||||
>>> source = '''import json; json.l'''
|
||||
>>> script = jedi.Script(source, 1, 19, '')
|
||||
>>> script
|
||||
<jedi.api.Script at 0x7f6d40f3db90>
|
||||
>>> completions = script.complete()
|
||||
>>> completions
|
||||
[<Completion: load>, <Completion: loads>]
|
||||
>>> completions[0].complete
|
||||
'oad'
|
||||
>>> 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.
|
||||
"""
|
||||
__all__ = ['Script', 'NotFoundError', 'set_debug_function']
|
||||
|
||||
import re
|
||||
|
||||
Reference in New Issue
Block a user