1
0
forked from VimPlug/jedi

BaseDefinition -> BaseName

This commit is contained in:
Dave Halter
2020-03-17 09:25:30 +01:00
parent c2451ddd03
commit 0731206b9d
6 changed files with 13 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ will probably be Jedi 1.0.0.
- ``call_signatures`` deprecated, use ``get_signatures`` instead - ``call_signatures`` deprecated, use ``get_signatures`` instead
- ``usages`` deprecated, use ``get_references`` instead - ``usages`` deprecated, use ``get_references`` instead
- ``jedi.names`` deprecated, use ``jedi.Script(...).get_names()`` - ``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 - Add follow_imports to ``Definition.goto``. Now its signature matches
``Script.goto``. ``Script.goto``.
- **Python 2 support deprecated**. For this release it is best effort. Python 2 - **Python 2 support deprecated**. For this release it is best effort. Python 2

View File

@@ -7,7 +7,7 @@ API Return Classes
Abstract Base Class Abstract Base Class
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
.. autoclass:: jedi.api.classes.BaseDefinition .. autoclass:: jedi.api.classes.BaseName
:members: :members:
:show-inheritance: :show-inheritance:

View File

@@ -445,7 +445,7 @@ class Script(object):
Used to display a help window to users. Uses :meth:`.Script.goto` and Used to display a help window to users. Uses :meth:`.Script.goto` and
returns additional definitions for keywords and operators. 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. user for all the returned definitions.
The additional definitions are ``Definition(...).type == 'keyword'``. The additional definitions are ``Definition(...).type == 'keyword'``.

View File

@@ -1,7 +1,7 @@
""" """
There are a couple of classes documented in here: 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:`.Definition` used in a lot of places
- :class:`.Completion` for completions - :class:`.Completion` for completions
- :class:`.BaseSignature` as a base class for signatures - :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] 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. The base class for all definitions, completions and signatures.
""" """
@@ -593,7 +593,7 @@ class BaseDefinition(object):
return self._name.infer().get_type_hint() return self._name.infer().get_type_hint()
class Completion(BaseDefinition): class Completion(BaseName):
""" """
``Completion`` objects are returned from :meth:`.Script.complete`. They ``Completion`` objects are returned from :meth:`.Script.complete`. They
provide additional information about a completion. provide additional information about a completion.
@@ -664,7 +664,7 @@ class Completion(BaseDefinition):
def docstring(self, raw=False, fast=True): def docstring(self, raw=False, fast=True):
""" """
Documentated under :meth:`BaseDefinition.docstring`. Documentated under :meth:`BaseName.docstring`.
""" """
if self._like_name_length >= 3: if self._like_name_length >= 3:
# In this case we can just resolve the like name, because we # In this case we can just resolve the like name, because we
@@ -702,7 +702,7 @@ class Completion(BaseDefinition):
@property @property
def type(self): def type(self):
""" """
Documentated under :meth:`BaseDefinition.type`. Documentated under :meth:`BaseName.type`.
""" """
# Purely a speed optimization. # Purely a speed optimization.
if self._cached_name is not None: 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()) 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 *Definition* objects are returned from many different APIs including
:meth:`.Script.goto` or :meth:`.Script.infer`. :meth:`.Script.goto` or :meth:`.Script.infer`.
@@ -774,7 +774,7 @@ class Definition(BaseDefinition):
class BaseSignature(Definition): class BaseSignature(Definition):
""" """
These signatures are returned by :meth:`BaseDefinition.get_signatures` These signatures are returned by :meth:`BaseName.get_signatures`
calls. calls.
""" """
def __init__(self, inference_state, signature): def __init__(self, inference_state, signature):

View File

@@ -23,7 +23,7 @@ def test_basedefinition_type(Script, get_names):
""" """
Return a list of definitions for parametrized tests. Return a list of definitions for parametrized tests.
:rtype: [jedi.api_classes.BaseDefinition] :rtype: [jedi.api_classes.BaseName]
""" """
source = dedent(""" source = dedent("""
import sys 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 function. They are not really different in functionality, but really
different as an implementation. different as an implementation.
""" """

View File

@@ -1,5 +1,5 @@
""" """
Tests for :attr:`.BaseDefinition.full_name`. Tests for :attr:`.BaseName.full_name`.
There are three kinds of test: There are three kinds of test: