[][src]Module ra_ap_syntax::algo

FIXME: write short doc here

Structs

SyntaxRewriter
TreeDiff

Enums

InsertPosition

Functions

ancestors_at_offset

Returns ancestors of the node at the offset, sorted by length. This should do the right thing at an edge, e.g. when searching for expressions at { <|>foo } we will get the name reference instead of the whole block, which we would get if we just did find_token_at_offset(...).flat_map(|t| t.parent().ancestors()).

diff

Finds minimal the diff, which, applied to from, will result in to.

find_covering_element
find_node_at_offset

Finds a node of specific Ast type at offset. Note that this is slightly imprecise: if the cursor is strictly between two nodes of the desired type, as in

find_node_at_range
has_errors
insert_children

Adds specified children (tokens or nodes) to the current node at the specific position.

least_common_ancestor
neighbor
non_trivia_sibling

Finds the first sibling in the given direction which is not trivia

replace_children

Replaces all nodes in to_delete with nodes from to_insert

skip_trivia_token

Skip to next non trivia token