File tree Expand file tree Collapse file tree
crates/ide-assists/src/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use ide_db:: source_change:: SourceChangeBuilder ;
22use syntax:: {
33 AstNode , AstToken ,
4- ast:: { self , IsString , syntax_factory :: SyntaxFactory } ,
4+ ast:: { self , IsString } ,
55} ;
66
77use crate :: {
@@ -164,16 +164,15 @@ fn replace_literal(
164164) {
165165 let old_token = token. syntax ( ) ;
166166 let parent = old_token. parent ( ) . expect ( "no parent token" ) ;
167- let make = SyntaxFactory :: with_mappings ( ) ;
168167 let editor = builder. make_editor ( & parent) ;
168+ let make = editor. make ( ) ;
169169 let new_literal = make. expr_literal ( new) ;
170170 let new_token = new_literal
171171 . syntax ( )
172172 . first_child_or_token ( )
173173 . and_then ( |it| it. into_token ( ) )
174174 . expect ( "literal has no token child" ) ;
175175 editor. replace ( old_token, new_token) ;
176- editor. add_mappings ( make. finish_with_mappings ( ) ) ;
177176 builder. add_file_edits ( ctx. vfs_file_id ( ) , editor) ;
178177}
179178
You can’t perform that action at this time.
0 commit comments