fix completion bugs
This commit is contained in:
@@ -10,6 +10,7 @@ pub(super) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte
|
||||
if !(ctx.is_trivial_path && ctx.function_syntax.is_some()) {
|
||||
return;
|
||||
}
|
||||
|
||||
snippet(ctx, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc);
|
||||
snippet(ctx, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc);
|
||||
}
|
||||
@@ -47,6 +48,18 @@ mod tests {
|
||||
check_snippet_completion("snippets_in_expressions", r"fn foo(x: i32) { <|> }");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_not_complete_snippets_in_path() {
|
||||
check_snippet_completion(
|
||||
"should_not_complete_snippets_in_path",
|
||||
r"fn foo(x: i32) { ::foo<|> }",
|
||||
);
|
||||
check_snippet_completion(
|
||||
"should_not_complete_snippets_in_path2",
|
||||
r"fn foo(x: i32) { ::<|> }",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_snippets_in_items() {
|
||||
check_snippet_completion(
|
||||
|
||||
Reference in New Issue
Block a user