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:
Benjamin Woodruff 2019-10-17 14:25:05 -07:00 committed by jimmylai
parent 9d68a58c17
commit 94e40d84ac
2 changed files with 10 additions and 8 deletions

View file

@ -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

View file

@ -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.