From 7f16f922da0ed2c231e34239e1de39994d0740a1 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sun, 13 Jan 2019 13:32:52 +0100 Subject: Tweak message shown for query fallback Small tweak for #518 --- crates/ra_ide_api/src/hover.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 2968b807c..c445d4fa1 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -21,7 +21,11 @@ pub(crate) fn hover( match ref_result { Exact(nav) => res.extend(doc_text_for(db, nav)?), Approximate(navs) => { - res.push("Failed to exactly resolve the symbol. This is probably because rust_analyzer does not yet support glob imports or traits. \nThese methods were found instead:".to_string()); + let mut msg = String::from("Failed to exactly resolve the symbol. This is probably because rust_analyzer does not yet support glob imports or traits."); + if !navs.is_empty() { + msg.push_str(" \nThese items were found instead:"); + } + res.push(msg); for nav in navs { res.extend(doc_text_for(db, nav)?) } -- cgit v1.2.3