forked from VimPlug/jedi
merged dev and linter
This commit is contained in:
@@ -349,7 +349,7 @@ class Script(object):
|
||||
Use :attr:`.call_signatures` instead.
|
||||
.. todo:: Remove!
|
||||
"""
|
||||
warnings.warn("Use line instead.", DeprecationWarning)
|
||||
warnings.warn("Use call_signatures instead.", DeprecationWarning)
|
||||
sig = self.call_signatures()
|
||||
return sig[0] if sig else None
|
||||
|
||||
|
||||
+9
-8
@@ -251,7 +251,7 @@ class BaseDefinition(object):
|
||||
Use :meth:`.docstring` instead.
|
||||
.. todo:: Remove!
|
||||
"""
|
||||
warnings.warn("Use documentation() instead.", DeprecationWarning)
|
||||
warnings.warn("Use docstring() instead.", DeprecationWarning)
|
||||
return self.docstring()
|
||||
|
||||
@property
|
||||
@@ -261,7 +261,7 @@ class BaseDefinition(object):
|
||||
Use :meth:`.docstring` instead.
|
||||
.. todo:: Remove!
|
||||
"""
|
||||
warnings.warn("Use documentation() instead.", DeprecationWarning)
|
||||
warnings.warn("Use docstring() instead.", DeprecationWarning)
|
||||
return self.docstring(raw=True)
|
||||
|
||||
@property
|
||||
@@ -313,11 +313,12 @@ class BaseDefinition(object):
|
||||
stripped = self._definition
|
||||
if isinstance(stripped, pr.Name):
|
||||
stripped = stripped.parent
|
||||
# We should probably work in `Finder._names_to_types` here.
|
||||
if isinstance(stripped, pr.Function):
|
||||
stripped = er.Function(self._evaluator, stripped)
|
||||
elif isinstance(stripped, pr.Class):
|
||||
stripped = er.Class(self._evaluator, stripped)
|
||||
|
||||
# We should probably work in `Finder._names_to_types` here.
|
||||
if isinstance(stripped, pr.Function):
|
||||
stripped = er.Function(self._evaluator, stripped)
|
||||
elif isinstance(stripped, pr.Class):
|
||||
stripped = er.Class(self._evaluator, stripped)
|
||||
|
||||
if stripped.isinstance(pr.Statement):
|
||||
return self._evaluator.eval_statement(stripped)
|
||||
@@ -469,7 +470,7 @@ class Completion(BaseDefinition):
|
||||
:param fast: Don't follow imports that are only one level deep like
|
||||
``import foo``, but follow ``from foo import bar``. This makes
|
||||
sense for speed reasons. Completing `import a` is slow if you use
|
||||
the ``foo.documentation(fast=False)`` on every object, because it
|
||||
the ``foo.docstring(fast=False)`` on every object, because it
|
||||
parses all libraries starting with ``a``.
|
||||
"""
|
||||
definition = self._definition
|
||||
|
||||
@@ -15,9 +15,13 @@ Then you will be able to use Jedi completer in your Python interpreter::
|
||||
os.path.join().split().index os.path.join().split().insert
|
||||
|
||||
"""
|
||||
|
||||
import jedi.utils
|
||||
from jedi import __version__ as __jedi_version__
|
||||
|
||||
print('REPL completion using Jedi %s' % __jedi_version__)
|
||||
jedi.utils.setup_readline()
|
||||
|
||||
del jedi
|
||||
|
||||
# Note: try not to do many things here, as it will contaminate global
|
||||
# namespace of the interpreter.
|
||||
|
||||
Reference in New Issue
Block a user