@@ -9,10 +9,11 @@ use ide_db::{
9
9
search:: FileReference ,
10
10
} ;
11
11
use itertools:: Itertools ;
12
+ use syntax:: ast:: syntax_factory:: SyntaxFactory ;
12
13
use syntax:: syntax_editor:: SyntaxEditor ;
13
14
use syntax:: {
14
15
AstNode , NodeOrToken , SyntaxNode ,
15
- ast:: { self , HasGenericParams , HasName , make } ,
16
+ ast:: { self , HasGenericParams , HasName } ,
16
17
} ;
17
18
18
19
use crate :: {
@@ -206,8 +207,8 @@ impl LifetimeMap {
206
207
alias_generics : & ast:: GenericParamList ,
207
208
) -> Option < Self > {
208
209
let mut inner = FxHashMap :: default ( ) ;
209
-
210
- let wildcard_lifetime = make:: lifetime ( "'_" ) ;
210
+ let make = SyntaxFactory :: without_mappings ( ) ;
211
+ let wildcard_lifetime = make. lifetime ( "'_" ) ;
211
212
let lifetimes = alias_generics
212
213
. lifetime_params ( )
213
214
. filter_map ( |lp| lp. lifetime ( ) )
@@ -334,9 +335,10 @@ fn create_replacement(
334
335
} ;
335
336
let new_string = replacement_syntax. to_string ( ) ;
336
337
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 ( )
338
340
} else {
339
- replacement_syntax. clone_for_update ( )
341
+ replacement_syntax. clone ( )
340
342
} ;
341
343
342
344
replacements. push ( ( syntax. clone ( ) , new) ) ;
@@ -385,12 +387,15 @@ impl ConstOrTypeGeneric {
385
387
}
386
388
387
389
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
+ )
394
399
}
395
400
}
396
401
0 commit comments