Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
Fix file mapping state when we have a parsed module but not a typeche…
Browse files Browse the repository at this point in the history
…cked module
  • Loading branch information
wz1000 committed Jun 16, 2019
1 parent b818cfa commit ddb5b90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hie-plugin-api/Haskell/Ide/Engine/ModuleCache.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ cacheModule uri modul = do
let defInfo = CachedInfo mempty mempty mempty mempty rfm return return
return $ case muc of
Just (UriCacheSuccess uc) ->
let newCI = (cachedInfo uc) { revMap = rfm }
let newCI = oldCI { revMap = rfm . revMap oldCI }
-- ^^^^^^^^^^^^
-- We have to retain the old mapping state, since the
-- old TypecheckedModule still contains spans relative to that
oldCI = cachedInfo uc
in uc { cachedPsMod = pm, cachedInfo = newCI }
_ -> UriCache defInfo pm Nothing mempty

Expand Down

0 comments on commit ddb5b90

Please sign in to comment.