elvis_code (elvis_core v4.1.0)
View SourceSummary
Functions
Same as calling find/3 with #{mode => node, traverse => content}
as the options map.
Find all nodes in the tree for which the predicate function returns true
. The options map has two keys
Debugging utility function.
Debugging utility function.
Types
Functions
-spec code_zipper(ktn_code:tree_node()) -> zipper:zipper(_).
-spec code_zipper(ktn_code:tree_node(), content | all) -> zipper:zipper(_).
-spec find(fun((zipper:zipper(_)) -> boolean()), ktn_code:tree_node()) -> [ktn_code:tree_node()].
Same as calling find/3 with #{mode => node, traverse => content}
as the options map.
-spec find(fun((zipper:zipper(_)) -> boolean()), ktn_code:tree_node(), find_options()) -> [ktn_code:tree_node()].
Find all nodes in the tree for which the predicate function returns true
. The options map has two keys:
- -
mode
: when the valuenode
is specified the predicate function receives a tree_node() as its argument. Whenzipper
is specified the argument is the zipper location for the current node. - -
traverse
: the valuecontent
indicates to only take into account nodes in the parent-child hierarchy. Whenall
is provided the nodes held in thenode_attrs
map are also taken into account in the search.
-spec find_by_location(ktn_code:tree_node(), {integer(), integer()}) -> not_found | {ok, ktn_code:tree_node()}.
-spec find_token(ktn_code:tree_node(), {integer(), integer()}) -> not_found | {ok, map()}.
-spec print_node(ktn_code:tree_node()) -> ok.
Debugging utility function.
-spec print_node(ktn_code:tree_node(), integer()) -> ok.
Debugging utility function.