diff options
Diffstat (limited to 'crates/ide/src/expand_macro.rs')
-rw-r--r-- | crates/ide/src/expand_macro.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs index ffb3a6f7d..d5628e3df 100644 --- a/crates/ide/src/expand_macro.rs +++ b/crates/ide/src/expand_macro.rs | |||
@@ -23,6 +23,8 @@ pub struct ExpandedMacro { | |||
23 | // | 23 | // |
24 | // | VS Code | **Rust Analyzer: Expand macro recursively** | 24 | // | VS Code | **Rust Analyzer: Expand macro recursively** |
25 | // |=== | 25 | // |=== |
26 | // | ||
27 | // image::https://user-images.githubusercontent.com/48062697/113020648-b3973180-917a-11eb-84a9-ecb921293dc5.gif[] | ||
26 | pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<ExpandedMacro> { | 28 | pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<ExpandedMacro> { |
27 | let sema = Semantics::new(db); | 29 | let sema = Semantics::new(db); |
28 | let file = sema.parse(position.file_id); | 30 | let file = sema.parse(position.file_id); |
@@ -101,6 +103,9 @@ fn insert_whitespaces(syn: SyntaxNode) -> String { | |||
101 | format!("\n{}}}", " ".repeat(indent)) | 103 | format!("\n{}}}", " ".repeat(indent)) |
102 | } | 104 | } |
103 | R_CURLY => format!("}}\n{}", " ".repeat(indent)), | 105 | R_CURLY => format!("}}\n{}", " ".repeat(indent)), |
106 | LIFETIME_IDENT if is_next(|it| it == IDENT, true) => { | ||
107 | format!("{} ", token.text().to_string()) | ||
108 | } | ||
104 | T![;] => format!(";\n{}", " ".repeat(indent)), | 109 | T![;] => format!(";\n{}", " ".repeat(indent)), |
105 | T![->] => " -> ".to_string(), | 110 | T![->] => " -> ".to_string(), |
106 | T![=] => " = ".to_string(), | 111 | T![=] => " = ".to_string(), |