File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/tools/rust-analyzer/crates/ide-completion/src/completions/item_list Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,10 @@ fn add_function_impl(
180
180
) {
181
181
let fn_name = func. name ( ctx. db ) ;
182
182
183
+ let is_async = func. is_async ( ctx. db ) ;
183
184
let label = format_smolstr ! (
184
- "fn {}({})" ,
185
+ "{}fn {}({})" ,
186
+ if is_async { "async " } else { "" } ,
185
187
fn_name. display( ctx. db) ,
186
188
if func. assoc_fn_params( ctx. db) . is_empty( ) { "" } else { ".." }
187
189
) ;
@@ -193,7 +195,7 @@ fn add_function_impl(
193
195
} ) ;
194
196
195
197
let mut item = CompletionItem :: new ( completion_kind, replacement_range, label) ;
196
- item. lookup_by ( format ! ( "fn {}" , fn_name. display( ctx. db) ) )
198
+ item. lookup_by ( format ! ( "{} fn {}" , if is_async { "async " } else { "" } , fn_name. display( ctx. db) ) )
197
199
. set_documentation ( func. docs ( ctx. db ) )
198
200
. set_relevance ( CompletionRelevance { is_item_from_trait : true , ..Default :: default ( ) } ) ;
199
201
You can’t perform that action at this time.
0 commit comments