@@ -131,7 +131,7 @@ pub struct SemanticsImpl<'db> {
131131 pub db : & ' db dyn HirDatabase ,
132132 s2d_cache : RefCell < SourceToDefCache > ,
133133 /// Rootnode to HirFileId cache
134- cache : RefCell < FxHashMap < SyntaxNode , HirFileId > > ,
134+ root_to_file_cache : RefCell < FxHashMap < SyntaxNode , HirFileId > > ,
135135 // These 2 caches are mainly useful for semantic highlighting as nothing else descends a lot of tokens
136136 // So we might wanna move them out into something specific for semantic highlighting
137137 expansion_info_cache : RefCell < FxHashMap < MacroFileId , ExpansionInfo > > ,
@@ -294,7 +294,7 @@ impl<'db> SemanticsImpl<'db> {
294294 SemanticsImpl {
295295 db,
296296 s2d_cache : Default :: default ( ) ,
297- cache : Default :: default ( ) ,
297+ root_to_file_cache : Default :: default ( ) ,
298298 expansion_info_cache : Default :: default ( ) ,
299299 macro_call_cache : Default :: default ( ) ,
300300 }
@@ -690,6 +690,7 @@ impl<'db> SemanticsImpl<'db> {
690690 exp_info
691691 } ) ;
692692
693+ // FIXME: uncached parse
693694 // Create the source analyzer for the macro call scope
694695 let Some ( sa) = self . analyze_no_infer ( & self . parse_or_expand ( expansion_info. call_file ( ) ) )
695696 else {
@@ -1025,6 +1026,7 @@ impl<'db> SemanticsImpl<'db> {
10251026 None => {
10261027 let call_node = file_id. macro_file ( ) ?. call_node ( db) ;
10271028 // cache the node
1029+ // FIXME: uncached parse
10281030 self . parse_or_expand ( call_node. file_id ) ;
10291031 Some ( call_node)
10301032 }
@@ -1397,7 +1399,7 @@ impl<'db> SemanticsImpl<'db> {
13971399
13981400 fn cache ( & self , root_node : SyntaxNode , file_id : HirFileId ) {
13991401 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 ( ) ;
14011403 let prev = cache. insert ( root_node, file_id) ;
14021404 assert ! ( prev. is_none( ) || prev == Some ( file_id) )
14031405 }
@@ -1407,7 +1409,7 @@ impl<'db> SemanticsImpl<'db> {
14071409 }
14081410
14091411 fn lookup ( & self , root_node : & SyntaxNode ) -> Option < HirFileId > {
1410- let cache = self . cache . borrow ( ) ;
1412+ let cache = self . root_to_file_cache . borrow ( ) ;
14111413 cache. get ( root_node) . copied ( )
14121414 }
14131415
@@ -1427,7 +1429,7 @@ impl<'db> SemanticsImpl<'db> {
14271429 known nodes: {}\n \n ",
14281430 node,
14291431 root_node,
1430- self . cache
1432+ self . root_to_file_cache
14311433 . borrow( )
14321434 . keys( )
14331435 . map( |it| format!( "{it:?}" ) )
0 commit comments