mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Track synthetic tokens, to be able to remove them again later
This commit is contained in:
parent
1b5cd03a37
commit
1a5aa84e9f
6 changed files with 133 additions and 39 deletions
|
@ -87,6 +87,16 @@ pub struct Ident {
|
|||
pub id: TokenId,
|
||||
}
|
||||
|
||||
impl Leaf {
|
||||
pub fn id(&self) -> TokenId {
|
||||
match self {
|
||||
Leaf::Literal(l) => l.id,
|
||||
Leaf::Punct(p) => p.id,
|
||||
Leaf::Ident(i) => i.id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn print_debug_subtree(f: &mut fmt::Formatter<'_>, subtree: &Subtree, level: usize) -> fmt::Result {
|
||||
let align = " ".repeat(level);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue