Add hir::Function::async_ret_type method

Adjust completion detail for `async fn` return types
This commit is contained in:
iDawer 2022-04-14 17:44:17 +05:00
parent f972adc201
commit 9d787e1bfe
3 changed files with 21 additions and 3 deletions

View file

@ -228,7 +228,7 @@ fn should_add_parens(ctx: &CompletionContext) -> bool {
}
fn detail(db: &dyn HirDatabase, func: hir::Function) -> String {
let ret_ty = func.ret_type(db);
let ret_ty = func.async_ret_type(db).unwrap_or_else(|| func.ret_type(db));
let mut detail = String::new();
if func.is_const(db) {