From 1b74eed8ca3abb14fa6ff404d1620397f3b2e4e8 Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Sun, 28 Jul 2019 12:33:21 +0100 Subject: Remove vertical ellipses from tests in complete_snippet.rs and presentation.rs --- .../ra_ide_api/src/completion/complete_snippet.rs | 44 +++--- crates/ra_ide_api/src/completion/presentation.rs | 152 ++++++++++----------- 2 files changed, 94 insertions(+), 102 deletions(-) (limited to 'crates/ra_ide_api/src/completion') diff --git a/crates/ra_ide_api/src/completion/complete_snippet.rs b/crates/ra_ide_api/src/completion/complete_snippet.rs index e0368b3b2..a35f31511 100644 --- a/crates/ra_ide_api/src/completion/complete_snippet.rs +++ b/crates/ra_ide_api/src/completion/complete_snippet.rs @@ -84,33 +84,31 @@ mod tests { #[test] fn completes_snippets_in_items() { assert_debug_snapshot_matches!( - do_snippet_completion( - r" + do_snippet_completion( + r" #[cfg(test)] mod tests { <|> } " - ), - @r###" - ⋮[ - ⋮ CompletionItem { - ⋮ label: "Test function", - ⋮ source_range: [78; 78), - ⋮ delete: [78; 78), - ⋮ insert: "#[test]\nfn ${1:feature}() {\n $0\n}", - ⋮ kind: Snippet, - ⋮ lookup: "tfn", - ⋮ }, - ⋮ CompletionItem { - ⋮ label: "pub(crate)", - ⋮ source_range: [78; 78), - ⋮ delete: [78; 78), - ⋮ insert: "pub(crate) $0", - ⋮ kind: Snippet, - ⋮ }, - ⋮] - "### - ); + ), + @r###"[ + CompletionItem { + label: "Test function", + source_range: [78; 78), + delete: [78; 78), + insert: "#[test]\nfn ${1:feature}() {\n $0\n}", + kind: Snippet, + lookup: "tfn", + }, + CompletionItem { + label: "pub(crate)", + source_range: [78; 78), + delete: [78; 78), + insert: "pub(crate) $0", + kind: Snippet, + }, +]"### + ); } } diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 5df19990c..6878008d3 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs @@ -194,64 +194,60 @@ mod tests { fn inserts_parens_for_function_calls() { covers!(inserts_parens_for_function_calls); assert_debug_snapshot_matches!( - do_reference_completion( - r" + do_reference_completion( + r" fn no_args() {} fn main() { no_<|> } " - ), - @r###" - ⋮[ - ⋮ CompletionItem { - ⋮ label: "main", - ⋮ source_range: [61; 64), - ⋮ delete: [61; 64), - ⋮ insert: "main()$0", - ⋮ kind: Function, - ⋮ detail: "fn main()", - ⋮ }, - ⋮ CompletionItem { - ⋮ label: "no_args", - ⋮ source_range: [61; 64), - ⋮ delete: [61; 64), - ⋮ insert: "no_args()$0", - ⋮ kind: Function, - ⋮ detail: "fn no_args()", - ⋮ }, - ⋮] - "### - ); + ), + @r###"[ + CompletionItem { + label: "main", + source_range: [61; 64), + delete: [61; 64), + insert: "main()$0", + kind: Function, + detail: "fn main()", + }, + CompletionItem { + label: "no_args", + source_range: [61; 64), + delete: [61; 64), + insert: "no_args()$0", + kind: Function, + detail: "fn no_args()", + }, +]"### + ); assert_debug_snapshot_matches!( - do_reference_completion( - r" + do_reference_completion( + r" fn with_args(x: i32, y: String) {} fn main() { with_<|> } " - ), - @r###" - ⋮[ - ⋮ CompletionItem { - ⋮ label: "main", - ⋮ source_range: [80; 85), - ⋮ delete: [80; 85), - ⋮ insert: "main()$0", - ⋮ kind: Function, - ⋮ detail: "fn main()", - ⋮ }, - ⋮ CompletionItem { - ⋮ label: "with_args", - ⋮ source_range: [80; 85), - ⋮ delete: [80; 85), - ⋮ insert: "with_args($0)", - ⋮ kind: Function, - ⋮ detail: "fn with_args(x: i32, y: String)", - ⋮ }, - ⋮] - "### - ); + ), + @r###"[ + CompletionItem { + label: "main", + source_range: [80; 85), + delete: [80; 85), + insert: "main()$0", + kind: Function, + detail: "fn main()", + }, + CompletionItem { + label: "with_args", + source_range: [80; 85), + delete: [80; 85), + insert: "with_args($0)", + kind: Function, + detail: "fn with_args(x: i32, y: String)", + }, +]"### + ); assert_debug_snapshot_matches!( - do_reference_completion( - r" + do_reference_completion( + r" struct S {} impl S { fn foo(&self) {} @@ -260,33 +256,31 @@ mod tests { s.f<|> } " - ), - @r###" - ⋮[ - ⋮ CompletionItem { - ⋮ label: "foo", - ⋮ source_range: [163; 164), - ⋮ delete: [163; 164), - ⋮ insert: "foo()$0", - ⋮ kind: Method, - ⋮ detail: "fn foo(&self)", - ⋮ }, - ⋮] - "### - ); + ), + @r###"[ + CompletionItem { + label: "foo", + source_range: [163; 164), + delete: [163; 164), + insert: "foo()$0", + kind: Method, + detail: "fn foo(&self)", + }, +]"### + ); } #[test] fn dont_render_function_parens_in_use_item() { assert_debug_snapshot_matches!( - do_reference_completion( - " + do_reference_completion( + " //- /lib.rs mod m { pub fn foo() {} } use crate::m::f<|>; " - ), - @r#"[ + ), + @r#"[ CompletionItem { label: "foo", source_range: [40; 41), @@ -296,22 +290,22 @@ mod tests { detail: "pub fn foo()", }, ]"# - ); + ); } #[test] fn dont_render_function_parens_if_already_call() { assert_debug_snapshot_matches!( - do_reference_completion( - " + do_reference_completion( + " //- /lib.rs fn frobnicate() {} fn main() { frob<|>(); } " - ), - @r#"[ + ), + @r#"[ CompletionItem { label: "frobnicate", source_range: [35; 39), @@ -329,10 +323,10 @@ mod tests { detail: "fn main()", }, ]"# - ); + ); assert_debug_snapshot_matches!( - do_reference_completion( - " + do_reference_completion( + " //- /lib.rs struct Foo {} impl Foo { fn new() -> Foo {} } @@ -340,8 +334,8 @@ mod tests { Foo::ne<|>(); } " - ), - @r#"[ + ), + @r#"[ CompletionItem { label: "new", source_range: [67; 69), @@ -351,6 +345,6 @@ mod tests { detail: "fn new() -> Foo", }, ]"# - ); + ); } } -- cgit v1.2.3