We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b1978a commit 1c1d900Copy full SHA for 1c1d900
crates/ide_completion/src/render/function.rs
@@ -110,7 +110,19 @@ fn render(
110
111
fn detail(db: &dyn HirDatabase, func: hir::Function) -> String {
112
let ret_ty = func.ret_type(db);
113
- let mut detail = format!("fn({})", params_display(db, func));
+ let mut detail = String::new();
114
+
115
+ if func.is_const(db) {
116
+ format_to!(detail, "const ");
117
+ }
118
+ if func.is_async(db) {
119
+ format_to!(detail, "async ");
120
121
+ if func.is_unsafe(db) {
122
+ format_to!(detail, "unsafe ");
123
124
125
+ format_to!(detail, "fn({})", params_display(db, func));
126
if !ret_ty.is_unit() {
127
format_to!(detail, " -> {}", ret_ty.display(db));
128
}
0 commit comments