Skip to content

Commit 45090e4

Browse files
author
Anatol Ulrich
committed
add multi-token mappings for hover
1 parent b251a30 commit 45090e4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

crates/ide/src/hover.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ pub(crate) fn hover(
127127
ControlFlow::Continue(_) => {
128128
if fallback.is_none() {
129129
// FIXME we're only taking the first fallback into account that's not `None`
130-
fallback = type_hover(&sema, config, &token);
130+
fallback = hover_for_keyword(&sema, config, &token)
131+
.or(type_hover(&sema, config, &token));
131132
}
132133
None
133134
}
@@ -274,10 +275,6 @@ fn find_hover_result(
274275
}
275276
}
276277

277-
if let Some(res) = hover_for_keyword(&sema, config, &token) {
278-
return Some(ControlFlow::Break(res));
279-
}
280-
281278
Some(ControlFlow::Continue(()))
282279
}
283280

@@ -304,7 +301,6 @@ fn type_hover(
304301

305302
let res = hover_type_info(&sema, config, &expr_or_pat)?;
306303
let range = sema.original_range(&node).range;
307-
308304
Some(RangeInfo::new(range, res))
309305
}
310306

0 commit comments

Comments
 (0)