mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
add postfix completion for dbg!()
with .dbg
This commit is contained in:
parent
da3802b2ce
commit
1c5a63e3db
5 changed files with 212 additions and 6 deletions
|
@ -42,6 +42,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
|
|||
)
|
||||
.add_to(acc);
|
||||
postfix_snippet(ctx, "while", &format!("while {} {{\n$0\n}}", receiver_text)).add_to(acc);
|
||||
postfix_snippet(ctx, "dbg", &format!("dbg!({})", receiver_text)).add_to(acc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,4 +93,17 @@ mod tests {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter_postfix_completion4() {
|
||||
check_snippet_completion(
|
||||
"filter_postfix_completion4",
|
||||
r#"
|
||||
fn main() {
|
||||
let bar = "a";
|
||||
bar.dbg<|>
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue