mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
fix completion bugs
This commit is contained in:
parent
488326ffa7
commit
13d2fd32ab
30 changed files with 179 additions and 135 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue