@@ -1351,14 +1351,14 @@ type CapturedNameResolution(p:pos, i:Item, io:ItemOccurence, de:DisplayEnv, nre:
13511351
13521352/// Represents container for all name resolutions that were met so far when typechecking some particular file
13531353type TcResolutions
1354- ( capturedEnvs : ResizeArray< range* NameResolutionEnv* AccessorDomain>,
1354+ ( capturedEnvsByLine : ResizeArray< ResizeArray < range* NameResolutionEnv* AccessorDomain> >,
13551355 capturedExprTypes: ResizeArray< pos* TType* DisplayEnv* NameResolutionEnv* AccessorDomain* range>,
13561356 capturedNameResolutions: ResizeArray< CapturedNameResolution>,
13571357 capturedMethodGroupResolutions: ResizeArray< CapturedNameResolution>) =
13581358
13591359static let empty = TcResolutions( ResizeArray( 0 ), ResizeArray( 0 ), ResizeArray( 0 ), ResizeArray( 0 ))
13601360
1361- member this.CapturedEnvs = capturedEnvs
1361+ member this.CapturedEnvsByLine = capturedEnvsByLine
13621362member this.CapturedExpressionTypings = capturedExprTypes
13631363member this.CapturedNameResolutions = capturedNameResolutions
13641364member this.CapturedMethodGroupResolutions = capturedMethodGroupResolutions
@@ -1383,7 +1383,7 @@ type TcSymbolUses(g, capturedNameResolutions : ResizeArray<CapturedNameResolutio
13831383
13841384/// An accumulator for the results being emitted into the tcSink.
13851385type TcResultsSinkImpl ( g , ? source : string ) =
1386- let capturedEnvs = ResizeArray<_ >()
1386+ let capturedEnvsByLine = ResizeArray< ResizeArray < range * NameResolutionEnv * AccessorDomain > >()
13871387let capturedExprTypings = ResizeArray<_>()
13881388let capturedNameResolutions = ResizeArray<_>()
13891389let capturedFormatSpecifierLocations = ResizeArray<_>()
@@ -1396,15 +1396,18 @@ type TcResultsSinkImpl(g, ?source: string) =
13961396let allowedRange ( m : range ) = not m.IsSynthetic
13971397
13981398member this.GetResolutions () =
1399- TcResolutions( capturedEnvs , capturedExprTypings, capturedNameResolutions, capturedMethodGroupResolutions)
1399+ TcResolutions( capturedEnvsByLine , capturedExprTypings, capturedNameResolutions, capturedMethodGroupResolutions)
14001400
14011401member this.GetSymbolUses () =
14021402 TcSymbolUses( g, capturedNameResolutions, capturedFormatSpecifierLocations.ToArray())
14031403
14041404interface ITypecheckResultsSinkwith
1405- member sink.NotifyEnvWithScope ( m , nenv , ad ) =
1406- if allowedRange mthen
1407- capturedEnvs.Add(( m, nenv, ad))
1405+ member sink.NotifyEnvWithScope ( m , nenv , ad ) =
1406+ if allowedRange mthen
1407+ for iin capturedEnvsByLine.Count.. m.EndLinedo
1408+ capturedEnvsByLine.Add( ResizeArray())
1409+ for linein m.StartLine.. m.EndLinedo
1410+ capturedEnvsByLine.[ line]. Add( m, nenv, ad)
14081411
14091412member sink.NotifyExprHasType ( endPos , ty , denv , nenv , ad , m ) =
14101413if allowedRange mthen