@@ -75,7 +75,7 @@ pub(crate) fn write_shared(
75
75
76
76
let external_crates = hack_get_external_crate_names ( cx) ?;
77
77
78
- let sources = PartsAndLocations :: < SourcesPart > :: get ( cx) ?;
78
+ let sources = PartsAndLocations :: < SourcesPart > :: get ( cx, & crate_name_json ) ?;
79
79
let SerializedSearchIndex { index, desc } = build_index ( & krate, & mut Rc :: get_mut ( & mut cx. shared ) . unwrap ( ) . cache , tcx) ;
80
80
let search_index = PartsAndLocations :: < SearchIndexPart > :: get ( cx, index) ?;
81
81
let all_crates = PartsAndLocations :: < AllCratesPart > :: get ( crate_name_json. clone ( ) ) ?;
@@ -372,7 +372,7 @@ createSrcSidebar();")
372
372
}
373
373
}
374
374
impl PartsAndLocations < SourcesPart > {
375
- fn get ( cx : & Context < ' _ > ) -> Result < Self , Error > {
375
+ fn get ( cx : & Context < ' _ > , crate_name : & SortedJson ) -> Result < Self , Error > {
376
376
let hierarchy = Rc :: new ( Hierarchy :: default ( ) ) ;
377
377
cx
378
378
. shared
@@ -381,7 +381,9 @@ impl PartsAndLocations<SourcesPart> {
381
381
. filter_map ( |p| p. 0 . strip_prefix ( & cx. shared . src_root ) . ok ( ) )
382
382
. for_each ( |source| hierarchy. add_path ( source) ) ;
383
383
let path = suffix_path ( "src-files.js" , & cx. shared . resource_suffix ) ;
384
- Ok ( Self :: with ( path, hierarchy. to_json_string ( ) ) )
384
+ let hierarchy = hierarchy. to_json_string ( ) ;
385
+ let part = SortedJson :: array_unsorted ( [ crate_name, & hierarchy] ) ;
386
+ Ok ( Self :: with ( path, part) )
385
387
}
386
388
}
387
389
@@ -463,7 +465,7 @@ impl NamedPart for TypeAliasPart {
463
465
} else {
464
466
window.pending_type_impls = type_impls;
465
467
}
466
- })()) " )
468
+ })()" )
467
469
}
468
470
}
469
471
@@ -580,7 +582,7 @@ impl NamedPart for TraitAliasPart {
580
582
} else {
581
583
window.pending_implementors = implementors;
582
584
}
583
- })()) " )
585
+ })()" )
584
586
}
585
587
}
586
588
impl PartsAndLocations < TraitAliasPart > {
@@ -872,7 +874,6 @@ fn write_rendered_cci<T: NamedPart + DeserializeOwned + fmt::Display + fmt::Debu
872
874
}
873
875
// write the merged cci to disk
874
876
for ( path, template) in templates {
875
- dbg ! ( & path, & template, & cx. dst) ;
876
877
create_parents ( cx, & path) ?;
877
878
let file = try_err ! ( File :: create( & path) , & path) ;
878
879
let mut file = BufWriter :: new ( file) ;
0 commit comments