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(
180180) {
181181 let fn_name = func. name ( ctx. db ) ;
182182
183+ let is_async = func. is_async ( ctx. db ) ;
183184 let label = format_smolstr ! (
184- "fn {}({})" ,
185+ "{}fn {}({})" ,
186+ if is_async { "async " } else { "" } ,
185187 fn_name. display( ctx. db) ,
186188 if func. assoc_fn_params( ctx. db) . is_empty( ) { "" } else { ".." }
187189 ) ;
@@ -193,7 +195,7 @@ fn add_function_impl(
193195 } ) ;
194196
195197 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) ) )
197199 . set_documentation ( func. docs ( ctx. db ) )
198200 . set_relevance ( CompletionRelevance { is_item_from_trait : true , ..Default :: default ( ) } ) ;
199201
You can’t perform that action at this time.
0 commit comments