mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Add simple test for syntax_node_to_token_tree_censored
This commit is contained in:
parent
d6134b6802
commit
1195cb50c2
4 changed files with 46 additions and 3 deletions
|
@ -15,14 +15,14 @@ use tt::buffer::{Cursor, TokenBuffer};
|
|||
use crate::{subtree_source::SubtreeTokenSource, tt_iter::TtIter};
|
||||
use crate::{ExpandError, TokenMap};
|
||||
|
||||
/// Convert the syntax node to a `TokenTree` with the censored nodes excluded (what macro
|
||||
/// Convert the syntax node to a `TokenTree` (what macro
|
||||
/// will consume).
|
||||
pub fn syntax_node_to_token_tree(node: &SyntaxNode) -> (tt::Subtree, TokenMap) {
|
||||
syntax_node_to_token_tree_censored(node, None)
|
||||
}
|
||||
|
||||
/// Convert the syntax node to a `TokenTree` with the censored nodes excluded (what macro
|
||||
/// will consume).
|
||||
/// Convert the syntax node to a `TokenTree` (what macro will consume)
|
||||
/// with the censored range excluded.
|
||||
pub fn syntax_node_to_token_tree_censored(
|
||||
node: &SyntaxNode,
|
||||
censor: Option<TextRange>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue