@@ -9,10 +9,11 @@ use ide_db::{
99 search:: FileReference ,
1010} ;
1111use itertools:: Itertools ;
12+ use syntax:: ast:: syntax_factory:: SyntaxFactory ;
1213use syntax:: syntax_editor:: SyntaxEditor ;
1314use syntax:: {
1415 AstNode , NodeOrToken , SyntaxNode ,
15- ast:: { self , HasGenericParams , HasName , make } ,
16+ ast:: { self , HasGenericParams , HasName } ,
1617} ;
1718
1819use crate :: {
@@ -206,8 +207,8 @@ impl LifetimeMap {
206207 alias_generics : & ast:: GenericParamList ,
207208 ) -> Option < Self > {
208209 let mut inner = FxHashMap :: default ( ) ;
209-
210- let wildcard_lifetime = make:: lifetime ( "'_" ) ;
210+ let make = SyntaxFactory :: without_mappings ( ) ;
211+ let wildcard_lifetime = make. lifetime ( "'_" ) ;
211212 let lifetimes = alias_generics
212213 . lifetime_params ( )
213214 . filter_map ( |lp| lp. lifetime ( ) )
@@ -334,9 +335,10 @@ fn create_replacement(
334335 } ;
335336 let new_string = replacement_syntax. to_string ( ) ;
336337 let new = if new_string == "_" {
337- make:: wildcard_pat ( ) . syntax ( ) . clone_for_update ( )
338+ let make = SyntaxFactory :: without_mappings ( ) ;
339+ make. wildcard_pat ( ) . syntax ( ) . clone ( )
338340 } else {
339- replacement_syntax. clone_for_update ( )
341+ replacement_syntax. clone ( )
340342 } ;
341343
342344 replacements. push ( ( syntax. clone ( ) , new) ) ;
@@ -385,12 +387,15 @@ impl ConstOrTypeGeneric {
385387 }
386388
387389 fn replacement_value ( & self ) -> Option < SyntaxNode > {
388- Some ( match self {
389- ConstOrTypeGeneric :: ConstArg ( ca) => ca. expr ( ) ?. syntax ( ) . clone ( ) ,
390- ConstOrTypeGeneric :: TypeArg ( ta) => ta. syntax ( ) . clone ( ) ,
391- ConstOrTypeGeneric :: ConstParam ( cp) => cp. default_val ( ) ?. syntax ( ) . clone ( ) ,
392- ConstOrTypeGeneric :: TypeParam ( tp) => tp. default_type ( ) ?. syntax ( ) . clone ( ) ,
393- } )
390+ Some (
391+ match self {
392+ ConstOrTypeGeneric :: ConstArg ( ca) => ca. expr ( ) ?. syntax ( ) . clone ( ) ,
393+ ConstOrTypeGeneric :: TypeArg ( ta) => ta. syntax ( ) . clone ( ) ,
394+ ConstOrTypeGeneric :: ConstParam ( cp) => cp. default_val ( ) ?. syntax ( ) . clone ( ) ,
395+ ConstOrTypeGeneric :: TypeParam ( tp) => tp. default_type ( ) ?. syntax ( ) . clone ( ) ,
396+ }
397+ . clone_for_update ( ) ,
398+ )
394399 }
395400}
396401
0 commit comments