@@ -362,7 +362,16 @@ impl SQLiteWriter {
362
362
path. display( graph, partials)
363
363
) ;
364
364
let start_node = graph[ path. start_node ] . id ( ) ;
365
- if start_node. is_in_file ( file) {
365
+ if start_node. is_root ( ) {
366
+ copious_debugging ! (
367
+ " * Add as root path with symbol stack {}" ,
368
+ path. symbol_stack_precondition. display( graph, partials) ,
369
+ ) ;
370
+ let symbol_stack = path. symbol_stack_precondition . storage_key ( graph, partials) ;
371
+ let path = serde:: PartialPath :: from_partial_path ( graph, partials, path) ;
372
+ root_stmt. execute ( ( file_str, symbol_stack, & serde_json:: to_vec ( & path) ?) ) ?;
373
+ root_path_count += 1 ;
374
+ } else if start_node. is_in_file ( file) {
366
375
copious_debugging ! (
367
376
" * Add as node path from node {}" ,
368
377
path. start_node. display( graph) ,
@@ -374,15 +383,6 @@ impl SQLiteWriter {
374
383
& serde_json:: to_vec ( & path) ?,
375
384
) ) ?;
376
385
node_path_count += 1 ;
377
- } else if start_node. is_root ( ) {
378
- copious_debugging ! (
379
- " * Add as root path with symbol stack {}" ,
380
- path. symbol_stack_precondition. display( graph, partials) ,
381
- ) ;
382
- let symbol_stack = path. symbol_stack_precondition . storage_key ( graph, partials) ;
383
- let path = serde:: PartialPath :: from_partial_path ( graph, partials, path) ;
384
- root_stmt. execute ( ( file_str, symbol_stack, & serde_json:: to_vec ( & path) ?) ) ?;
385
- root_path_count += 1 ;
386
386
} else {
387
387
panic ! (
388
388
"added path {} must start in given file {} or at root" ,
0 commit comments