[][src]Trait taplo::util::SyntaxExt

pub trait SyntaxExt {
    fn find_node(&self, offset: TextSize, inclusive: bool) -> Option<SyntaxNode>;
fn find(&self, kind: SyntaxKind) -> Option<SyntaxElement>; fn find_node_deep(
        &self,
        offset: TextSize,
        inclusive: bool
    ) -> Option<SyntaxNode> { ... } }
[]

Utility extension methods for Syntax Nodes.

Required methods

fn find_node(&self, offset: TextSize, inclusive: bool) -> Option<SyntaxNode>[]

Return a syntax node that contains the given offset.

fn find(&self, kind: SyntaxKind) -> Option<SyntaxElement>[]

Find a node or token by its kind.

Provided methods

fn find_node_deep(
    &self,
    offset: TextSize,
    inclusive: bool
) -> Option<SyntaxNode>
[]

Find the deepest node that contains the given offset.

Implementors

impl SyntaxExt for SyntaxNode[src][+]