@@ -22,14 +22,23 @@ pub fn create_func_heads<'a>(
22
22
ast_workspace : & AstWorkspace ,
23
23
options : & BuildOptions ,
24
24
) -> Result < ( ) , ResolveError > {
25
- for ( physical_file_id, file ) in ast_workspace. files . iter ( ) {
26
- let module_folder_id = ast_workspace. get_owning_module_or_self ( * physical_file_id) ;
25
+ for ( physical_file_id, ast_file ) in ast_workspace. files . iter ( ) {
26
+ let module_folder_id = ast_workspace. get_owning_module_or_self ( physical_file_id) ;
27
27
28
- create_impl_heads ( ctx, asg, options, module_folder_id, * physical_file_id, file) ?;
28
+ create_impl_heads (
29
+ ctx,
30
+ asg,
31
+ options,
32
+ module_folder_id,
33
+ physical_file_id,
34
+ ast_file,
35
+ ) ?;
36
+
37
+ for func_id in ast_file. funcs . iter ( ) {
38
+ let func = & ast_workspace. all_funcs [ func_id] ;
29
39
30
- for ( func_i, func) in file. funcs . iter ( ) . enumerate ( ) {
31
40
let name = if func. head . privacy . is_private ( ) {
32
- ResolvedName :: new ( * physical_file_id, & Name :: plain ( & func. head . name ) )
41
+ ResolvedName :: new ( physical_file_id, & Name :: plain ( & func. head . name ) )
33
42
} else {
34
43
ResolvedName :: new ( module_folder_id, & Name :: plain ( & func. head . name ) )
35
44
} ;
@@ -41,7 +50,7 @@ pub fn create_func_heads<'a>(
41
50
name. clone ( ) ,
42
51
& func. head ,
43
52
module_folder_id,
44
- * physical_file_id,
53
+ physical_file_id,
45
54
) ?;
46
55
47
56
if func. head . privacy . is_public ( ) {
@@ -53,8 +62,10 @@ pub fn create_func_heads<'a>(
53
62
. push ( func_ref) ;
54
63
}
55
64
56
- let settings = file. settings . map ( |id| & ast_workspace. settings [ id. 0 ] ) ;
57
- let imported_namespaces = settings. map ( |settings| & settings. imported_namespaces ) ;
65
+ let imported_namespaces = ast_workspace
66
+ . view ( ast_file)
67
+ . settings
68
+ . map ( |settings| & settings. imported_namespaces ) ;
58
69
59
70
let func_haystack = ctx. func_haystacks . get_or_insert_with ( module_folder_id, || {
60
71
FuncHaystack :: new (
@@ -72,7 +83,7 @@ pub fn create_func_heads<'a>(
72
83
. or_insert_with ( || vec ! [ func_ref] ) ;
73
84
74
85
ctx. jobs
75
- . push_back ( FuncJob :: Regular ( * physical_file_id, func_i , func_ref) ) ;
86
+ . push_back ( FuncJob :: Regular ( physical_file_id, func_id , func_ref) ) ;
76
87
}
77
88
}
78
89
0 commit comments