forked from VimPlug/jedi
Some minor docstring improvements
This commit is contained in:
@@ -66,20 +66,20 @@ def _no_python2_support(func):
|
|||||||
class Script(object):
|
class Script(object):
|
||||||
"""
|
"""
|
||||||
A Script is the base for completions, goto or whatever you want to do with
|
A Script is the base for completions, goto or whatever you want to do with
|
||||||
|jedi|. The counter part of this class is :class:`Interpreter`, which works
|
Jedi. The counter part of this class is :class:`Interpreter`, which works
|
||||||
with actual namespaces and can complete in a shell as well. This class
|
with actual dictionaries and can work with a REPL. This class
|
||||||
should be used when a user edits code in an editor.
|
should be used when a user edits code in an editor.
|
||||||
|
|
||||||
You can either use the ``code`` parameter or ``path`` to read a file.
|
You can either use the ``code`` parameter or ``path`` to read a file.
|
||||||
Usually you're going to want to use both of them (in an editor).
|
Usually you're going to want to use both of them (in an editor).
|
||||||
|
|
||||||
The script might be analyzed in a different ``sys.path`` than |jedi|:
|
The Script's ``sys.path`` is very customizable:
|
||||||
|
|
||||||
- If `project` is provided with a ``sys_path``, that is going to be used.
|
- If `project` is provided with a ``sys_path``, that is going to be used.
|
||||||
- If `environment` is provided, its ``sys.path`` will be used
|
- If `environment` is provided, its ``sys.path`` will be used
|
||||||
(see :func:`Environment.get_sys_path <jedi.api.environment.Environment.get_sys_path>`);
|
(see :func:`Environment.get_sys_path <jedi.api.environment.Environment.get_sys_path>`);
|
||||||
- Otherwise ``sys.path`` will match that of the default environment of
|
- Otherwise ``sys.path`` will match that of the default environment of
|
||||||
|jedi|, which typically matches the sys path that was used at the time
|
Jedi, which typically matches the sys path that was used at the time
|
||||||
when Jedi was imported.
|
when Jedi was imported.
|
||||||
|
|
||||||
Most methods have a ``line`` and a ``column`` parameter. Lines in Jedi are
|
Most methods have a ``line`` and a ``column`` parameter. Lines in Jedi are
|
||||||
@@ -504,7 +504,7 @@ class Script(object):
|
|||||||
@validate_line_column
|
@validate_line_column
|
||||||
def get_signatures(self, line=None, column=None):
|
def get_signatures(self, line=None, column=None):
|
||||||
"""
|
"""
|
||||||
Return the function object of the call the cursor is on.
|
Return the function object of the call under the cursor.
|
||||||
|
|
||||||
E.g. if the cursor is here::
|
E.g. if the cursor is here::
|
||||||
|
|
||||||
@@ -541,8 +541,8 @@ class Script(object):
|
|||||||
@validate_line_column
|
@validate_line_column
|
||||||
def get_context(self, line=None, column=None):
|
def get_context(self, line=None, column=None):
|
||||||
"""
|
"""
|
||||||
Returns the context of cursor. This basically means the function, class
|
Returns the scope context under the cursor. This basically means the
|
||||||
or module where the cursor is at.
|
function, class or module where the cursor is at.
|
||||||
|
|
||||||
:rtype: :class:`.Name`
|
:rtype: :class:`.Name`
|
||||||
"""
|
"""
|
||||||
@@ -615,7 +615,7 @@ class Script(object):
|
|||||||
|
|
||||||
def get_names(self, **kwargs):
|
def get_names(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
Returns names defined in the current module.
|
Returns names defined in the current file.
|
||||||
|
|
||||||
:param all_scopes: If True lists the names of all scopes instead of
|
:param all_scopes: If True lists the names of all scopes instead of
|
||||||
only the module namespace.
|
only the module namespace.
|
||||||
|
|||||||
+1
-1
@@ -213,7 +213,7 @@ class Project(object):
|
|||||||
|
|
||||||
def search(self, string, **kwargs):
|
def search(self, string, **kwargs):
|
||||||
"""
|
"""
|
||||||
Tries to look in a whole project for names. If the project is very big,
|
Searches a name in the whole project. If the project is very big,
|
||||||
at some point Jedi will stop searching. However it's also very much
|
at some point Jedi will stop searching. However it's also very much
|
||||||
recommended to not exhaust the generator. Just display the first ten
|
recommended to not exhaust the generator. Just display the first ten
|
||||||
results to the user.
|
results to the user.
|
||||||
|
|||||||
Reference in New Issue
Block a user