Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover.rs')
| -rw-r--r-- | crates/ide/src/hover.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 2058a4f5f1..5f2c61f5b5 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -201,6 +201,23 @@ fn hover_simple( Some(render::struct_rest_pat(sema, config, &record_pat)) }) + }) + // try () call hovers + .or_else(|| { + descended().find_map(|token| { + if token.kind() != T!['('] && token.kind() != T![')'] { + return None; + } + let arg_list = token.parent().and_then(ast::ArgList::cast)?.syntax().parent()?; + let call_expr = syntax::match_ast! { + match arg_list { + ast::CallExpr(expr) => expr.into(), + ast::MethodCallExpr(expr) => expr.into(), + _ => return None, + } + }; + render::type_info_of(sema, config, &Either::Left(call_expr)) + }) }); result.map(|mut res: HoverResult| { |