[][src]Struct rslint_rowan::cursor::SyntaxNode

pub struct SyntaxNode(_);

Implementations

impl SyntaxNode[src]

pub fn new_root(green: GreenNode) -> SyntaxNode[src]

pub fn replace_with(&self, replacement: GreenNode) -> GreenNode[src]

Returns a green tree, equal to the green tree this node belongs two, except with this node substitute. The complexity of operation is proportional to the depth of the tree

pub fn kind(&self) -> SyntaxKind[src]

pub fn text_range(&self) -> TextRange[src]

pub fn text(&self) -> SyntaxText[src]

pub fn green(&self) -> &GreenNode[src]

pub fn parent(&self) -> Option<SyntaxNode>[src]

pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode>[src]

pub fn children(&self) -> SyntaxNodeChildren

Notable traits for SyntaxNodeChildren

impl Iterator for SyntaxNodeChildren type Item = SyntaxNode;
[src]

pub fn children_with_tokens(&self) -> SyntaxElementChildren[src]

pub fn first_child(&self) -> Option<SyntaxNode>[src]

pub fn first_child_or_token(&self) -> Option<SyntaxElement>[src]

pub fn last_child(&self) -> Option<SyntaxNode>[src]

pub fn last_child_or_token(&self) -> Option<SyntaxElement>[src]

pub fn next_sibling(&self) -> Option<SyntaxNode>[src]

pub fn next_sibling_or_token(&self) -> Option<SyntaxElement>[src]

pub fn prev_sibling(&self) -> Option<SyntaxNode>[src]

pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement>[src]

pub fn first_token(&self) -> Option<SyntaxToken>[src]

Return the leftmost token in the subtree of this node

pub fn last_token(&self) -> Option<SyntaxToken>[src]

Return the rightmost token in the subtree of this node

pub fn siblings(&self, direction: Direction) -> impl Iterator<Item = SyntaxNode>[src]

pub fn siblings_with_tokens(
    &self,
    direction: Direction
) -> impl Iterator<Item = SyntaxElement>
[src]

pub fn descendants(&self) -> impl Iterator<Item = SyntaxNode>[src]

pub fn descendants_with_tokens(&self) -> impl Iterator<Item = SyntaxElement>[src]

pub fn preorder(&self) -> impl Iterator<Item = WalkEvent<SyntaxNode>>[src]

Traverse the subtree rooted at the current node (including the current node) in preorder, excluding tokens.

pub fn preorder_with_tokens<'a>(
    &'a self
) -> impl Iterator<Item = WalkEvent<SyntaxElement>>
[src]

Traverse the subtree rooted at the current node (including the current node) in preorder, including tokens.

pub fn token_at_offset(&self, offset: TextSize) -> TokenAtOffset<SyntaxToken>

Notable traits for TokenAtOffset<T>

impl<T> Iterator for TokenAtOffset<T> type Item = T;
[src]

Find a token in the subtree corresponding to this node, which covers the offset. Precondition: offset must be withing node's range.

pub fn covering_element(&self, range: TextRange) -> SyntaxElement[src]

Return the deepest node or token in the current subtree that fully contains the range. If the range is empty and is contained in two leaf nodes, either one can be returned. Precondition: range must be contained withing the current node

Trait Implementations

impl Clone for SyntaxNode[src]

impl Debug for SyntaxNode[src]

impl Display for SyntaxNode[src]

impl Drop for SyntaxNode[src]

impl Eq for SyntaxNode[src]

impl<L: Language> From<SyntaxNode<L>> for SyntaxNode[src]

impl From<SyntaxNode> for SyntaxElement[src]

impl<L: Language> From<SyntaxNode> for SyntaxNode<L>[src]

impl Hash for SyntaxNode[src]

impl PartialEq<SyntaxNode> for SyntaxNode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erasable for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.