Commit graph

11 commits

Author SHA1 Message Date
Caleb Donovick
0ee0831eb6
Add FlattenSentinel to support replacing a statement with multiple statements (#455)
* Add flatten_sentinal

* Add FlattenSentinal to __all__

* Fix lint errors

* Fix type errors

* Update test to use leave_Return

* Update and run codegen

* Add empty test

* Update docs

* autofix
2021-03-22 23:23:40 -07:00
Christopher Hunt
6520d25816 Fix visitor helper function name pattern in docs 2019-10-04 21:40:52 -07:00
Jennifer Taylor
27b5a1d286 Improve removing nodes from parents in LibCST.
Add a RemoveFromParent() function as a convenience to returning RemovalSentinel.REMOVE.
Introduce a `deep_remove()` on CSTNode analogous to `deep_replace()` but for removing.
2019-10-02 15:43:48 -07:00
Jennifer Taylor
e2868f703b Add documentation to matchers. 2019-10-01 15:28:58 -07:00
Gareth T
41af9de31d [docs] Small update and corrections to documentation. (#55) 2019-09-03 10:30:08 -07:00
Jennifer Taylor
0d2b66a1e7 Add more documentation around attribute visitors.
Adds a bit more documentation to various pieces of attribute visitors.
Adds a section around traversal order of visitors given a tree.
2019-08-29 14:16:51 -07:00
Ray Zeng
e2f2eafc59 Add extended example for metadata and fix some docstrings 2019-08-16 10:34:30 -07:00
Ray Zeng
63ff16cb47 Add more metadata documentation 2019-08-16 10:34:30 -07:00
Benjamin Woodruff
90e4efb348 Add docs for MaybeSentinel and RemovalSentinel
These were referred to by other parts of the documentation, and they
provide core parts of our functionality, so we should have explicit
documentation for them.
2019-08-08 11:04:02 -07:00
Jennifer Taylor
944f987b1f Better documentation for visitors. 2019-08-05 10:56:33 -07:00
Benjamin Woodruff
c0ac3d7049 Switch from automodule to autoclass everywhere
- Now that we're exporting everything from the top-level libcst package,
  automodule makes a mess of things.
- While it does create more boilerplate, using autoclass/autofunction
  instead of automodule gives us a lot more control over the order in
  which nodes are presented, so we can group them by various categories.

This diff also exports BaseParenthesizableWhitespace, because nodes
refer to it by type, and so it's needed for documentation purposes.
2019-07-29 10:51:59 -07:00