Type Definition rslint_parser::SyntaxNode [−][src]
pub type SyntaxNode = SyntaxNode<JsLanguage>;
Trait Implementations
Get all of the tokens of this node, recursively, including whitespace and comments.
Get all the tokens of this node, recursively, not including whitespace and comments.
Get the first non-whitespace child token.
Check if the node is a certain AST node and that it can be casted to it.
Compare two syntax nodes by comparing their underlying non-whitespace tokens. Read more
Syntax highlight the node’s text into an ANSI string. If stdout and stderr are not terminals, this will return the raw node text. Read more
Get the text range of this node, not including any leading or trailing whitespace. Read more
Get the text of this node, not including leading or trailing whitespace Read more
Check whether this node’s kind is contained in a token set.
A human readable name for this node’s kind. e.g.:
BREAK_STMT
=> Break statement
Read more
Go over the descendants of this node, at every descendant call func
, and keep traversing
the descendants of that node if the function’s return is true
. If the function returns false
then stop traversing the descendants of that node go on to the next child. Read more
Separate all the lossy tokens of this node, then compare each token’s text with the corresponding
text in tokens
. Read more
Whether the node contains any comments.
Get the first child with a specific kind.
Get the parent of this node, recursing through any grouping expressions
Get the first child in this node that can be casted to an AST node
fn descendants_with_tokens_with<F>(&self, func: &mut F) where
F: FnMut(&SyntaxElement) -> bool,
fn descendants_with_tokens_with<F>(&self, func: &mut F) where
F: FnMut(&SyntaxElement) -> bool,
Same as descendants_with
but considers tokens too.
Get a specific token in the node which matches a syntax kind. Read more