mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
fix: don't show pd/ppd completions where it shouldn't be
This commit is contained in:
parent
35db5e99f6
commit
e31a762c63
2 changed files with 5 additions and 11 deletions
|
@ -108,8 +108,6 @@ fn process(f: S) {
|
||||||
check_snippet(
|
check_snippet(
|
||||||
test_code,
|
test_code,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
sn pd
|
|
||||||
sn ppd
|
|
||||||
fd ..Default::default()
|
fd ..Default::default()
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
@ -179,13 +177,7 @@ fn process(f: S) {
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
|
||||||
check_snippet(
|
check_snippet(test_code, expect![[r#""#]]);
|
||||||
test_code,
|
|
||||||
expect![[r#"
|
|
||||||
sn pd
|
|
||||||
sn ppd
|
|
||||||
"#]],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -22,8 +22,10 @@ pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte
|
||||||
None => return,
|
None => return,
|
||||||
};
|
};
|
||||||
|
|
||||||
snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc);
|
if ctx.can_be_stmt {
|
||||||
snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc);
|
snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc);
|
||||||
|
snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionContext) {
|
pub(crate) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue