8993: fix: don't show pd/ppd completions where it shouldn't be r=flodiebold a=eduardocanellas

Closes #8992


Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
This commit is contained in:
bors[bot] 2021-05-25 19:58:49 +00:00 committed by GitHub
commit e23083f398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 11 deletions

View File

@ -108,8 +108,6 @@ fn process(f: S) {
check_snippet(
test_code,
expect![[r#"
sn pd
sn ppd
fd ..Default::default()
"#]],
);
@ -179,13 +177,7 @@ fn process(f: S) {
"#]],
);
check_snippet(
test_code,
expect![[r#"
sn pd
sn ppd
"#]],
);
check_snippet(test_code, expect![[r#""#]]);
}
#[test]

View File

@ -22,8 +22,10 @@ pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte
None => return,
};
snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc);
snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc);
if ctx.can_be_stmt {
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) {