From 6ae4c70a0aecea4c7c0c5a43fe443baa170ff1d4 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Sat, 17 Oct 2020 10:47:35 +0300 Subject: Improve test_no_completions_required test --- crates/ide/src/completion.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'crates/ide/src/completion.rs') diff --git a/crates/ide/src/completion.rs b/crates/ide/src/completion.rs index 570091ba3..69e875014 100644 --- a/crates/ide/src/completion.rs +++ b/crates/ide/src/completion.rs @@ -233,12 +233,28 @@ mod tests { #[test] fn test_no_completions_required() { + // There must be no hint for 'in' keyword. check_no_completion( r#" fn foo() { for i i<|> } "#, - ) + ); + // After 'in' keyword hints may be spawned. + check_detail_and_documentation( + r#" + /// Do the foo + fn foo() -> &'static str { "foo" } + + fn bar() { + for c in fo<|> + } + "#, + DetailAndDocumentation { + detail: "fn foo() -> &'static str", + documentation: "Do the foo", + }, + ); } } -- cgit v1.2.3