forked from VimPlug/jedi
BaseDefinition -> BaseName
This commit is contained in:
@@ -51,7 +51,7 @@ will probably be Jedi 1.0.0.
|
||||
- ``call_signatures`` deprecated, use ``get_signatures`` instead
|
||||
- ``usages`` deprecated, use ``get_references`` instead
|
||||
- ``jedi.names`` deprecated, use ``jedi.Script(...).get_names()``
|
||||
- ``BaseDefinition.goto_assignments`` renamed to ``BaseDefinition.goto``
|
||||
- ``BaseName.goto_assignments`` renamed to ``BaseName.goto``
|
||||
- Add follow_imports to ``Definition.goto``. Now its signature matches
|
||||
``Script.goto``.
|
||||
- **Python 2 support deprecated**. For this release it is best effort. Python 2
|
||||
|
||||
@@ -7,7 +7,7 @@ API Return Classes
|
||||
|
||||
Abstract Base Class
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
.. autoclass:: jedi.api.classes.BaseDefinition
|
||||
.. autoclass:: jedi.api.classes.BaseName
|
||||
:members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
@@ -445,7 +445,7 @@ class Script(object):
|
||||
Used to display a help window to users. Uses :meth:`.Script.goto` and
|
||||
returns additional definitions for keywords and operators.
|
||||
|
||||
Typically you will want to display :meth:`.BaseDefinition.docstring` to the
|
||||
Typically you will want to display :meth:`.BaseName.docstring` to the
|
||||
user for all the returned definitions.
|
||||
|
||||
The additional definitions are ``Definition(...).type == 'keyword'``.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
There are a couple of classes documented in here:
|
||||
|
||||
- :class:`.BaseDefinition` as an abstact base class for almost everything.
|
||||
- :class:`.BaseName` as an abstact base class for almost everything.
|
||||
- :class:`.Definition` used in a lot of places
|
||||
- :class:`.Completion` for completions
|
||||
- :class:`.BaseSignature` as a base class for signatures
|
||||
@@ -52,7 +52,7 @@ def _values_to_definitions(values):
|
||||
return [Definition(c.inference_state, c.name) for c in values]
|
||||
|
||||
|
||||
class BaseDefinition(object):
|
||||
class BaseName(object):
|
||||
"""
|
||||
The base class for all definitions, completions and signatures.
|
||||
"""
|
||||
@@ -593,7 +593,7 @@ class BaseDefinition(object):
|
||||
return self._name.infer().get_type_hint()
|
||||
|
||||
|
||||
class Completion(BaseDefinition):
|
||||
class Completion(BaseName):
|
||||
"""
|
||||
``Completion`` objects are returned from :meth:`.Script.complete`. They
|
||||
provide additional information about a completion.
|
||||
@@ -664,7 +664,7 @@ class Completion(BaseDefinition):
|
||||
|
||||
def docstring(self, raw=False, fast=True):
|
||||
"""
|
||||
Documentated under :meth:`BaseDefinition.docstring`.
|
||||
Documentated under :meth:`BaseName.docstring`.
|
||||
"""
|
||||
if self._like_name_length >= 3:
|
||||
# In this case we can just resolve the like name, because we
|
||||
@@ -702,7 +702,7 @@ class Completion(BaseDefinition):
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
Documentated under :meth:`BaseDefinition.type`.
|
||||
Documentated under :meth:`BaseName.type`.
|
||||
"""
|
||||
# Purely a speed optimization.
|
||||
if self._cached_name is not None:
|
||||
@@ -718,7 +718,7 @@ class Completion(BaseDefinition):
|
||||
return '<%s: %s>' % (type(self).__name__, self._name.get_public_name())
|
||||
|
||||
|
||||
class Definition(BaseDefinition):
|
||||
class Definition(BaseName):
|
||||
"""
|
||||
*Definition* objects are returned from many different APIs including
|
||||
:meth:`.Script.goto` or :meth:`.Script.infer`.
|
||||
@@ -774,7 +774,7 @@ class Definition(BaseDefinition):
|
||||
|
||||
class BaseSignature(Definition):
|
||||
"""
|
||||
These signatures are returned by :meth:`BaseDefinition.get_signatures`
|
||||
These signatures are returned by :meth:`BaseName.get_signatures`
|
||||
calls.
|
||||
"""
|
||||
def __init__(self, inference_state, signature):
|
||||
|
||||
@@ -23,7 +23,7 @@ def test_basedefinition_type(Script, get_names):
|
||||
"""
|
||||
Return a list of definitions for parametrized tests.
|
||||
|
||||
:rtype: [jedi.api_classes.BaseDefinition]
|
||||
:rtype: [jedi.api_classes.BaseName]
|
||||
"""
|
||||
source = dedent("""
|
||||
import sys
|
||||
@@ -375,7 +375,7 @@ def test_type_II(Script):
|
||||
|
||||
|
||||
"""
|
||||
This tests the BaseDefinition.goto function, not the jedi
|
||||
This tests the BaseName.goto function, not the jedi
|
||||
function. They are not really different in functionality, but really
|
||||
different as an implementation.
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Tests for :attr:`.BaseDefinition.full_name`.
|
||||
Tests for :attr:`.BaseName.full_name`.
|
||||
|
||||
There are three kinds of test:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user