Remove NameCache modification in the IDE (#1189)

* Remove NameCache modification

* Change the suggested list of replacements
This commit is contained in:
Neil Mitchell 2019-05-16 16:01:26 +01:00 committed by GitHub
parent c11c565ea4
commit 7c61967ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -172,6 +172,7 @@ loadPackage opt packageState us lps p =
let mods =
[ Module (DefiniteUnitId (DefUnitId p)) mod
| (mod, _mbParent) <- exposedMods
, False {- HLINT ignore "Short-circuited list comprehension" -}
]
forM_ mods $ \mod -> GHC.getModuleInfo mod
-- this populates the namecache and external package state
@ -336,12 +337,13 @@ setupEnv uniqSupply tms lps = do
foldl' (\fc (im, ifr) -> GHC.extendInstalledModuleEnv fc im ifr) fc
$ zip ims ifrs
-- construct a new NameCache
nc' <- mkNameCache uniqSupply tms lps
-- update the name cache
liftIO $ modifyIORef (hsc_NC session) $ const nc'
-- update the external package state
liftIO $ modifyIORef (hsc_EPS session) (updateEps lps)
when False $ do
-- construct a new NameCache
nc' <- mkNameCache uniqSupply tms lps
-- update the name cache
liftIO $ modifyIORef (hsc_NC session) $ const nc'
-- update the external package state
liftIO $ modifyIORef (hsc_EPS session) (updateEps lps)
-- load dependent modules, which must be in topological order.
mapM_ loadModuleHome tms

View File

@ -13,7 +13,7 @@
}
},
"source": "Compiler",
"message": "/tests/diagnostics/failed-name-resolution/Main.daml:8:11: error:\n • Variable not in scope: ab : Int\n • Perhaps you meant one of these:\n a (line 8), b (line 8), abs (imported from Prelude)"
"message": "/tests/diagnostics/failed-name-resolution/Main.daml:8:11: error:\n • Variable not in scope: ab : Int\n • Perhaps you meant one of these:\n a (line 8), b (line 8), ap (imported from Prelude)"
},
{
"severity": 1,
@ -32,7 +32,7 @@
}
],
"file:/tests/diagnostics/failed-name-resolution/Prelude.daml": [],
"file:/tests/diagnostics/failed-name-resolution/DA/Internal/Desugar.daml": [],
"file:/tests/diagnostics/failed-name-resolution/DA/Internal/Record.daml": [],
"file:/tests/diagnostics/failed-name-resolution/DA/Internal/Desugar.daml": [],
"file:/tests/diagnostics/failed-name-resolution/DA/Internal/RebindableSyntax.daml": []
}