@@ -266,7 +266,7 @@ data ShakeExtras = ShakeExtras
266
266
-- ^ Map from a text document version to a PositionMapping that describes how to map
267
267
-- positions in a version of that document to positions in the latest version
268
268
-- First mapping is delta from previous version and second one is an
269
- -- accumulation of all previous mappings .
269
+ -- accumulation to the current version .
270
270
,progress :: ProgressReporting
271
271
,ideTesting :: IdeTesting
272
272
-- ^ Whether to enable additional lsp messages used by the test suite for checking invariants
@@ -443,7 +443,7 @@ lastValueIO s@ShakeExtras{positionMapping,persistentKeys,state} k file = do
443
443
`catch` (\ (_ :: IOException ) -> pure Nothing )
444
444
atomicallyNamed " lastValueIO 2" $ do
445
445
STM. focus (Focus. alter (alterValue $ Stale (Just del) actual_version (toDyn v))) (toKey k file) state
446
- Just . (v,) . addDelta del <$> mappingForVersion positionMapping file actual_version
446
+ Just . (v,) . addOldDelta del <$> mappingForVersion positionMapping file actual_version
447
447
448
448
-- We got a new stale value from the persistent rule, insert it in the map without affecting diagnostics
449
449
alterValue new Nothing = Just (ValueWithDiagnostics new mempty ) -- If it wasn't in the map, give it empty diagnostics
@@ -459,7 +459,7 @@ lastValueIO s@ShakeExtras{positionMapping,persistentKeys,state} k file = do
459
459
Succeeded ver (fromDynamic -> Just v) ->
460
460
atomicallyNamed " lastValueIO 5" $ Just . (v,) <$> mappingForVersion positionMapping file ver
461
461
Stale del ver (fromDynamic -> Just v) ->
462
- atomicallyNamed " lastValueIO 6" $ Just . (v,) . maybe id addDelta del <$> mappingForVersion positionMapping file ver
462
+ atomicallyNamed " lastValueIO 6" $ Just . (v,) . maybe id addOldDelta del <$> mappingForVersion positionMapping file ver
463
463
Failed p | not p -> readPersistent
464
464
_ -> pure Nothing
465
465
@@ -1357,7 +1357,7 @@ updatePositionMapping IdeState{shakeExtras = ShakeExtras{positionMapping}} Versi
1357
1357
-- Very important to use mapAccum here so that the tails of
1358
1358
-- each mapping can be shared, otherwise quadratic space is
1359
1359
-- used which is evident in long running sessions.
1360
- EM. mapAccumRWithKey (\ acc _k (delta, _) -> let new = addDelta delta acc in (new, (delta, acc)))
1360
+ EM. mapAccumRWithKey (\ acc _k (delta, _) -> let new = addOldDelta delta acc in (new, (delta, acc)))
1361
1361
zeroMapping
1362
1362
(EM. insert _version (shared_change, zeroMapping) mappingForUri)
1363
1363
shared_change = mkDelta changes
0 commit comments