@@ -111,8 +111,8 @@ impl<Ctx: ParserCtxQuery> CompilerStage<Ctx> for Parser {
111111 let path = SourceMapUtils :: map ( id, |source| source. path ( ) . to_path_buf ( ) ) ;
112112 node_map. add_module ( id, ModuleEntry :: new ( path, node) ) ;
113113 }
114- ParserAction :: MergeSpans { spans } => scope. spawn ( move |_| {
115- SpanMap :: add_local_map ( spans) ;
114+ ParserAction :: MergeSpans { source , spans } => scope. spawn ( move |_| {
115+ SpanMap :: add_local_map ( source , spans) ;
116116 } ) ,
117117 ParserAction :: ParseImport { source, sender } => {
118118 // ##Note: import de-duplication is already ensured by the
@@ -172,7 +172,7 @@ pub enum ParserAction {
172172 Error { diagnostics : Vec < Report > , timings : StageMetrics } ,
173173
174174 /// Update the global `SPAN_MAP` with the specified local span map.
175- MergeSpans { spans : LocalSpanMap } ,
175+ MergeSpans { source : SourceId , spans : LocalSpanMap } ,
176176
177177 /// A worker has completed processing an interactive block and now provides
178178 /// the generated AST.
@@ -266,7 +266,7 @@ fn parse_source(source: ParseSource, sender: Sender<ParserAction>) {
266266 // are encountered whilst parsing this module.
267267 let resolver = ImportResolver :: new ( id, source. parent ( ) , sender) ;
268268 let mut diagnostics = ParserDiagnostics :: new ( ) ;
269- let mut spans = LocalSpanMap :: with_capacity ( id , tokens. len ( ) * 2 ) ;
269+ let mut spans = LocalSpanMap :: with_capacity ( tokens. len ( ) * 2 ) ;
270270 let mut gen = AstGen :: new ( spanned, & tokens, & resolver, & mut diagnostics, & mut spans) ;
271271
272272 // Perform the parsing operation now... and send the result through the
@@ -299,6 +299,6 @@ fn parse_source(source: ParseSource, sender: Sender<ParserAction>) {
299299
300300 // Send both the generated module, and the `LocalSpanMap` for updating
301301 // the global `SPAN_MAP`.
302- sender. send ( ParserAction :: MergeSpans { spans } ) . unwrap ( ) ;
302+ sender. send ( ParserAction :: MergeSpans { source : id , spans } ) . unwrap ( ) ;
303303 sender. send ( action) . unwrap ( ) ;
304304}
0 commit comments