mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
Reorder position providers in documentation
PositionProvider is the best choice in most cases, so it should come before WhitespaceInclusivePositionProvider in the documentation.
This commit is contained in:
parent
9d68a58c17
commit
94e40d84ac
2 changed files with 10 additions and 8 deletions
|
|
@ -70,9 +70,12 @@ not use the visitor pattern for computing metadata for a tree.
|
|||
------------------
|
||||
Metadata Providers
|
||||
------------------
|
||||
:class:`~libcst.metadata.WhitespaceInclusivePositionProvider`, :class:`~libcst.metadata.PositionProvider`,
|
||||
:class:`~libcst.metadata.ExpressionContextProvider`, :class:`~libcst.metadata.ScopeProvider`,
|
||||
:class:`~libcst.metadata.QualifiedNameProvider` and :class:`~libcst.metadata.ParentNodeProvider`
|
||||
:class:`~libcst.metadata.PositionProvider`,
|
||||
:class:`~libcst.metadata.WhitespaceInclusivePositionProvider`,
|
||||
:class:`~libcst.metadata.ExpressionContextProvider`,
|
||||
:class:`~libcst.metadata.ScopeProvider`,
|
||||
:class:`~libcst.metadata.QualifiedNameProvider`, and
|
||||
:class:`~libcst.metadata.ParentNodeProvider`
|
||||
are currently provided. Each metadata provider may has its own custom data structure.
|
||||
|
||||
Position Metadata
|
||||
|
|
@ -85,8 +88,8 @@ want.
|
|||
Node positions are is represented with :class:`~libcst.CodeRange` objects. See
|
||||
:ref:`the above example<libcst-metadata-position-example>`.
|
||||
|
||||
.. autoclass:: libcst.metadata.WhitespaceInclusivePositionProvider
|
||||
.. autoclass:: libcst.metadata.PositionProvider
|
||||
.. autoclass:: libcst.metadata.WhitespaceInclusivePositionProvider
|
||||
|
||||
.. autoclass:: libcst.CodeRange
|
||||
.. autoclass:: libcst.CodePosition
|
||||
|
|
|
|||
|
|
@ -144,10 +144,9 @@ class Module(CSTNode):
|
|||
method of Module, not CSTNode, because we need to know the module's default
|
||||
indentation and newline formats.
|
||||
|
||||
This can also be used with a
|
||||
:class:`~libcst.metadata.WhitespaceInclusivePositionProvider` or
|
||||
:class:`~libcst.metadata.PositionProvider` to compute position information, but
|
||||
that's an implementation detail, and you should use
|
||||
This can also be used with a :class:`~libcst.metadata.PositionProvider` or a
|
||||
:class:`~libcst.metadata.WhitespaceInclusivePositionProvider` to compute
|
||||
position information, but that's an implementation detail, and you should use
|
||||
:meth:`MetadataWrapper.resolve() <libcst.metadata.MetadataWrapper.resolve>`
|
||||
instead.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue