@@ -131,7 +131,7 @@ pub struct SemanticsImpl<'db> {
131
131
pub db : & ' db dyn HirDatabase ,
132
132
s2d_cache : RefCell < SourceToDefCache > ,
133
133
/// Rootnode to HirFileId cache
134
- cache : RefCell < FxHashMap < SyntaxNode , HirFileId > > ,
134
+ root_to_file_cache : RefCell < FxHashMap < SyntaxNode , HirFileId > > ,
135
135
// These 2 caches are mainly useful for semantic highlighting as nothing else descends a lot of tokens
136
136
// So we might wanna move them out into something specific for semantic highlighting
137
137
expansion_info_cache : RefCell < FxHashMap < MacroFileId , ExpansionInfo > > ,
@@ -294,7 +294,7 @@ impl<'db> SemanticsImpl<'db> {
294
294
SemanticsImpl {
295
295
db,
296
296
s2d_cache : Default :: default ( ) ,
297
- cache : Default :: default ( ) ,
297
+ root_to_file_cache : Default :: default ( ) ,
298
298
expansion_info_cache : Default :: default ( ) ,
299
299
macro_call_cache : Default :: default ( ) ,
300
300
}
@@ -690,6 +690,7 @@ impl<'db> SemanticsImpl<'db> {
690
690
exp_info
691
691
} ) ;
692
692
693
+ // FIXME: uncached parse
693
694
// Create the source analyzer for the macro call scope
694
695
let Some ( sa) = self . analyze_no_infer ( & self . parse_or_expand ( expansion_info. call_file ( ) ) )
695
696
else {
@@ -1025,6 +1026,7 @@ impl<'db> SemanticsImpl<'db> {
1025
1026
None => {
1026
1027
let call_node = file_id. macro_file ( ) ?. call_node ( db) ;
1027
1028
// cache the node
1029
+ // FIXME: uncached parse
1028
1030
self . parse_or_expand ( call_node. file_id ) ;
1029
1031
Some ( call_node)
1030
1032
}
@@ -1397,7 +1399,7 @@ impl<'db> SemanticsImpl<'db> {
1397
1399
1398
1400
fn cache ( & self , root_node : SyntaxNode , file_id : HirFileId ) {
1399
1401
assert ! ( root_node. parent( ) . is_none( ) ) ;
1400
- let mut cache = self . cache . borrow_mut ( ) ;
1402
+ let mut cache = self . root_to_file_cache . borrow_mut ( ) ;
1401
1403
let prev = cache. insert ( root_node, file_id) ;
1402
1404
assert ! ( prev. is_none( ) || prev == Some ( file_id) )
1403
1405
}
@@ -1407,7 +1409,7 @@ impl<'db> SemanticsImpl<'db> {
1407
1409
}
1408
1410
1409
1411
fn lookup ( & self , root_node : & SyntaxNode ) -> Option < HirFileId > {
1410
- let cache = self . cache . borrow ( ) ;
1412
+ let cache = self . root_to_file_cache . borrow ( ) ;
1411
1413
cache. get ( root_node) . copied ( )
1412
1414
}
1413
1415
@@ -1427,7 +1429,7 @@ impl<'db> SemanticsImpl<'db> {
1427
1429
known nodes: {}\n \n ",
1428
1430
node,
1429
1431
root_node,
1430
- self . cache
1432
+ self . root_to_file_cache
1431
1433
. borrow( )
1432
1434
. keys( )
1433
1435
. map( |it| format!( "{it:?}" ) )
0 commit comments