Add new type HoverResult to contain the results of hovering

This makes testing hovers easier as well as allows us to do more things with the
results if needed.
This commit is contained in:
Ville Penttinen 2019-02-26 18:56:04 +02:00
parent 3ec2584148
commit 6f5fd6c9de
3 changed files with 149 additions and 16 deletions

View file

@ -58,6 +58,7 @@ pub use crate::{
navigation_target::NavigationTarget,
references::ReferenceSearchResult,
assists::{Assist, AssistId},
hover::{HoverResult},
};
pub use ra_ide_api_light::{
Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit,
@ -328,7 +329,7 @@ impl Analysis {
}
/// Returns a short text describing element at position.
pub fn hover(&self, position: FilePosition) -> Cancelable<Option<RangeInfo<String>>> {
pub fn hover(&self, position: FilePosition) -> Cancelable<Option<RangeInfo<HoverResult>>> {
self.with_db(|db| hover::hover(db, position))
}