New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block filter passed to find_by method on Block should be able to skip subtree #2067
Comments
This is related to, but different from, #2900. |
…block returns :skip
An open question is whether it should be possible to include the node, but skip its children. |
I think we need to support both |
To be consistent with NodeFilter, I think we should change the definition we are using for
|
The problem with that proposal is that it would break a lot of uses of find_by that rely on the existing true/false behavior. Therefore, we'll need to stick with
|
…and its descendants or just descendants - honor :skip return value from filter block to skip node and its descendants - honor :skip_children return value from filter block to accept node, but skip its descendants
@Mogztter do you like this proposal? (see #2902 for the impl) |
…find_by to skip subtrees - interpret :skip return value of filter block to mean skip node and its descendants - interpret :skip_children return value of filter block to mean accept node, but skip its descendants
Currently, if the block filter passed to Block#find_by returns false, the corresponding node is not included in the result set. However, the method still continues to discover descendant nodes (i.e., descend the subtree). It should be possible to return a value, such as :skip, that tells the method to skip the subtree altogether.
Current (does not include dlist, but includes all children)
Proposed (does not include dlist or its children)
The text was updated successfully, but these errors were encountered: