@@ -558,12 +558,10 @@ impl StackGraphLanguage {
558558 stack_graph : & ' a mut StackGraph ,
559559 file : Handle < File > ,
560560 source : & ' a str ,
561- source_path : & Path ,
562- source_root : & Path ,
563561 globals : & ' a Variables < ' a > ,
564562 cancellation_flag : & ' a dyn CancellationFlag ,
565563 ) -> Result < ( ) , BuildError > {
566- self . builder_into_stack_graph ( stack_graph, file, source, source_path , source_root )
564+ self . builder_into_stack_graph ( stack_graph, file, source)
567565 . build ( globals, cancellation_flag)
568566 }
569567
@@ -576,10 +574,8 @@ impl StackGraphLanguage {
576574 stack_graph : & ' a mut StackGraph ,
577575 file : Handle < File > ,
578576 source : & ' a str ,
579- source_path : & ' a Path ,
580- source_root : & ' a Path ,
581577 ) -> Builder < ' a > {
582- Builder :: new ( self , stack_graph, file, source, source_path , source_root )
578+ Builder :: new ( self , stack_graph, file, source)
583579 }
584580}
585581
@@ -588,8 +584,6 @@ pub struct Builder<'a> {
588584 stack_graph : & ' a mut StackGraph ,
589585 file : Handle < File > ,
590586 source : & ' a str ,
591- source_path : & ' a Path ,
592- source_root : & ' a Path ,
593587 graph : Graph < ' a > ,
594588 remapped_nodes : HashMap < usize , NodeID > ,
595589 injected_node_count : usize ,
@@ -602,17 +596,13 @@ impl<'a> Builder<'a> {
602596 stack_graph : & ' a mut StackGraph ,
603597 file : Handle < File > ,
604598 source : & ' a str ,
605- source_path : & ' a Path ,
606- source_root : & ' a Path ,
607599 ) -> Self {
608600 let span_calculator = SpanCalculator :: new ( source) ;
609601 Builder {
610602 sgl,
611603 stack_graph,
612604 file,
613605 source,
614- source_path,
615- source_root,
616606 graph : Graph :: new ( ) ,
617607 remapped_nodes : HashMap :: new ( ) ,
618608 injected_node_count : 0 ,
@@ -659,19 +649,10 @@ impl<'a> Builder<'a> {
659649 . add ( JUMP_TO_SCOPE_NODE_VAR . into ( ) , jump_to_scope_node. into ( ) )
660650 . expect ( "Failed to set JUMP_TO_SCOPE_NODE" ) ;
661651
662- if globals. get ( & FILE_PATH_VAR . into ( ) ) . is_none ( ) {
663- let file_name = self . source_path . to_str ( ) . unwrap ( ) . to_string ( ) ;
664- globals
665- . add ( FILE_PATH_VAR . into ( ) , file_name. into ( ) )
666- . expect ( "Failed to set FILE_PATH" ) ;
667- }
668-
669- if globals. get ( & ROOT_PATH_VAR . into ( ) ) . is_none ( ) {
670- let root_path = self . source_root . to_str ( ) . unwrap ( ) . to_string ( ) ;
671- globals
672- . add ( ROOT_PATH_VAR . into ( ) , root_path. into ( ) )
673- . expect ( "Failed to set ROOT_PATH" ) ;
674- }
652+ // FILE_PATH is mandatory
653+ globals
654+ . get ( & FILE_PATH_VAR . into ( ) )
655+ . expect ( "FILE_PATH not set" ) ;
675656
676657 let mut config = ExecutionConfig :: new ( & self . sgl . functions , & globals)
677658 . lazy ( true )
0 commit comments