@@ -2,6 +2,7 @@ use std::iter::FusedIterator;
2
2
use std:: sync:: Arc ;
3
3
4
4
use rustc_hash:: FxHashMap ;
5
+ use salsa:: DebugWithDb ;
5
6
6
7
use ruff_db:: parsed:: parsed_module;
7
8
use ruff_db:: vfs:: VfsFile ;
@@ -28,6 +29,8 @@ type SymbolMap = hashbrown::HashMap<ScopedSymbolId, (), ()>;
28
29
/// Prefer using [`symbol_table`] when working with symbols from a single scope.
29
30
#[ salsa:: tracked( return_ref, no_eq) ]
30
31
pub ( crate ) fn semantic_index ( db : & dyn Db , file : VfsFile ) -> SemanticIndex {
32
+ let _ = tracing:: trace_span!( "semantic_index" , file = ?file. debug( db. upcast( ) ) ) . enter ( ) ;
33
+
31
34
let parsed = parsed_module ( db. upcast ( ) , file) ;
32
35
33
36
SemanticIndexBuilder :: new ( parsed) . build ( )
@@ -40,6 +43,7 @@ pub(crate) fn semantic_index(db: &dyn Db, file: VfsFile) -> SemanticIndex {
40
43
/// is unchanged.
41
44
#[ salsa:: tracked]
42
45
pub ( crate ) fn symbol_table ( db : & dyn Db , scope : ScopeId ) -> Arc < SymbolTable > {
46
+ let _ = tracing:: trace_span!( "symbol_table" , scope = ?scope. debug( db) ) . enter ( ) ;
43
47
let index = semantic_index ( db, scope. file ( db) ) ;
44
48
45
49
index. symbol_table ( scope. file_scope_id ( db) )
@@ -48,6 +52,8 @@ pub(crate) fn symbol_table(db: &dyn Db, scope: ScopeId) -> Arc<SymbolTable> {
48
52
/// Returns the root scope of `file`.
49
53
#[ salsa:: tracked]
50
54
pub ( crate ) fn root_scope ( db : & dyn Db , file : VfsFile ) -> ScopeId {
55
+ let _ = tracing:: trace_span!( "root_scope" , file = ?file. debug( db. upcast( ) ) ) . enter ( ) ;
56
+
51
57
FileScopeId :: root ( ) . to_scope_id ( db, file)
52
58
}
53
59
0 commit comments