From 1de7848b5710f21cccf90dabc99a0cf6fcdabad3 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 14 Nov 2020 14:59:03 +0200 Subject: Fix the other test --- .../completion/src/completions/unqualified_path.rs | 6 +++--- crates/completion/src/render.rs | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index fca8d3a72..362d31f25 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs @@ -747,7 +747,7 @@ impl My<|> } #[test] - fn function_magic_completion() { + fn function_fuzzy_completion() { check_edit( "stdin", r#" @@ -772,7 +772,7 @@ fn main() { } #[test] - fn macro_magic_completion() { + fn macro_fuzzy_completion() { check_edit( "macro_with_curlies!", r#" @@ -799,7 +799,7 @@ fn main() { } #[test] - fn case_insensitive_magic_completion_works() { + fn struct_fuzzy_completion() { check_edit( "ThirdStruct", r#" diff --git a/crates/completion/src/render.rs b/crates/completion/src/render.rs index 1fa02c375..5a4353846 100644 --- a/crates/completion/src/render.rs +++ b/crates/completion/src/render.rs @@ -425,6 +425,28 @@ fn main() { let _: m::Spam = S<|> } insert: "m", kind: Module, }, + CompletionItem { + label: "m::Spam", + source_range: 75..76, + text_edit: TextEdit { + indels: [ + Indel { + insert: "use m::Spam;", + delete: 0..0, + }, + Indel { + insert: "\n\n", + delete: 0..0, + }, + Indel { + insert: "Spam", + delete: 75..76, + }, + ], + }, + kind: Enum, + lookup: "Spam", + }, CompletionItem { label: "m::Spam::Foo", source_range: 75..76, -- cgit v1.2.3