aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/hover.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index a390dab65..9c35db2a4 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -5,7 +5,11 @@ use ra_syntax::{
5}; 5};
6use hir::HirDisplay; 6use hir::HirDisplay;
7 7
8use crate::{db::RootDatabase, RangeInfo, FilePosition, FileRange, display::{rust_code_markup, doc_text_for}}; 8use crate::{
9 db::RootDatabase,
10 RangeInfo, FilePosition, FileRange,
11 display::{rust_code_markup, doc_text_for},
12};
9 13
10/// Contains the results when hovering over an item 14/// Contains the results when hovering over an item
11#[derive(Debug, Clone)] 15#[derive(Debug, Clone)]
@@ -155,9 +159,11 @@ mod tests {
155 fn check_hover_result(fixture: &str, expected: &[&str]) { 159 fn check_hover_result(fixture: &str, expected: &[&str]) {
156 let (analysis, position) = analysis_and_position(fixture); 160 let (analysis, position) = analysis_and_position(fixture);
157 let hover = analysis.hover(position).unwrap().unwrap(); 161 let hover = analysis.hover(position).unwrap().unwrap();
162 let mut results = Vec::from(hover.info.results());
163 results.sort();
158 164
159 for (markup, expected) in 165 for (markup, expected) in
160 hover.info.results().iter().zip(expected.iter().chain(std::iter::repeat(&"<missing>"))) 166 results.iter().zip(expected.iter().chain(std::iter::repeat(&"<missing>")))
161 { 167 {
162 assert_eq!(trim_markup(&markup), *expected); 168 assert_eq!(trim_markup(&markup), *expected);
163 } 169 }