11//! FIXME: write short doc here
22
3- use ra_assists:: { resolved_assists, AssistAction , AssistLabel } ;
3+ use ra_assists:: { resolved_assists, AssistAction } ;
44use ra_db:: { FilePosition , FileRange } ;
55use ra_ide_db:: RootDatabase ;
66
@@ -21,27 +21,22 @@ pub(crate) fn assists(db: &RootDatabase, frange: FileRange) -> Vec<Assist> {
2121 . into_iter ( )
2222 . map ( |assist| {
2323 let file_id = frange. file_id ;
24- let assist_label = & assist. label ;
2524 Assist {
26- id : assist_label . id ,
27- label : assist_label . label . clone ( ) ,
28- group_label : assist. group_label . map ( |it| it. 0 ) ,
29- source_change : action_to_edit ( assist. action , file_id, assist_label ) ,
25+ id : assist . label . id ,
26+ label : assist . label . label . clone ( ) ,
27+ group_label : assist. label . group . map ( |it| it. 0 ) ,
28+ source_change : action_to_edit ( assist. action , file_id, assist . label . label . clone ( ) ) ,
3029 }
3130 } )
3231 . collect ( )
3332}
3433
35- fn action_to_edit (
36- action : AssistAction ,
37- file_id : FileId ,
38- assist_label : & AssistLabel ,
39- ) -> SourceChange {
34+ fn action_to_edit ( action : AssistAction , file_id : FileId , label : String ) -> SourceChange {
4035 let file_id = match action. file {
4136 ra_assists:: AssistFile :: TargetFile ( it) => it,
4237 _ => file_id,
4338 } ;
4439 let file_edit = SourceFileEdit { file_id, edit : action. edit } ;
45- SourceChange :: source_file_edit ( assist_label . label . clone ( ) , file_edit)
40+ SourceChange :: source_file_edit ( label, file_edit)
4641 . with_cursor_opt ( action. cursor_position . map ( |offset| FilePosition { offset, file_id } ) )
4742}
0 commit comments