pub(super) fn with_preceding_elements(
        &mut self,
        node: &SyntaxNode,
        f: &mut impl FnMut(SpaceBlockOrToken<'_>) -> bool,
    ) {
        let block = self.block_for(&node.clone().into(), BlockPosition::Before);
        if f(SpaceBlockOrToken::SpaceBlock(block)) {
            return;
        }

        for token in preceding_tokens(node).filter(|it| it.kind() != TOKEN_WHITESPACE) {
            if f(SpaceBlockOrToken::Token(token.clone())) {
                return;
            }

            let block = self.block_for(&token.clone().into(), BlockPosition::Before);
            if f(SpaceBlockOrToken::SpaceBlock(block)) {
                return;
            }
        }
    }
/// Traverses tokens and space blocks that precede the given `node`.
///
/// This is implemented as internal iterator due to lifetime issues.
Traverses tokens and space blocks that precede the given `node`.
This is implemented as internal iterator due to lifetime issues.
Traverses tokens and space blocks that precede the given ` node ` . This is implemented as internal iterator due to lifetime issues .
pub(super) fn with_preceding_elements(
        &mut self,
        node: &SyntaxNode,
        f: &mut impl FnMut(SpaceBlockOrToken<'_>) -> bool,
    ) {
        let block = self.block_for(&node.clone().into(), BlockPosition::Before);
        if f(SpaceBlockOrToken::SpaceBlock(block)) {
            return;
        }
        for token in preceding_tokens(node).filter(|it| it.kind() != TOKEN_WHITESPACE) {
            if f(SpaceBlockOrToken::Token(token.clone())) {
                return;
            }
            let block = self.block_for(&token.clone().into(), BlockPosition::Before);
            if f(SpaceBlockOrToken::SpaceBlock(block)) {
                return;
            }
        }
    }
pub ( super ) fn with_preceding_elements ( & mut self , node : & SyntaxNode , f : & mut impl FnMut ( SpaceBlockOrToken < ' _ > ) -> bool , ) { let block = self . block_for ( & node . clone ( ) . into ( ) , BlockPosition :: Before ) ; if f ( SpaceBlockOrToken :: SpaceBlock ( block ) ) { return ; } for token in preceding_tokens ( node ) . filter ( | it | it . kind ( ) != TOKEN_WHITESPACE ) { if f ( SpaceBlockOrToken :: Token ( token . clone ( ) ) ) { return ; } let block = self . block_for ( & token . clone ( ) . into ( ) , BlockPosition :: Before ) ; if f ( SpaceBlockOrToken :: SpaceBlock ( block ) ) { return ; } } }
Traverses tokens and space blocks that precede the given `node`.
Traverses tokens and space blocks that precede the given ` node ` .
&mut self
node
&SyntaxNode
f
&mut impl FnMut(SpaceBlockOrToken<'_>) -> bool