diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 7346ce0ebf..b394f55cff 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -2,7 +2,7 @@ cabal-version: 2.4 build-type: Simple category: Development name: ghcide -version: 1.4.0.1 +version: 1.4.0.2 license: Apache-2.0 license-file: LICENSE author: Digital Asset and Ghcide contributors diff --git a/ghcide/src/Development/IDE/Core/Compile.hs b/ghcide/src/Development/IDE/Core/Compile.hs index 4d64e978dd..340b7bebd0 100644 --- a/ghcide/src/Development/IDE/Core/Compile.hs +++ b/ghcide/src/Development/IDE/Core/Compile.hs @@ -528,13 +528,15 @@ spliceExpresions Splices{..} = -- can just increment the 'indexCompleted' TVar and exit. -- indexHieFile :: ShakeExtras -> ModSummary -> NormalizedFilePath -> Fingerprint -> Compat.HieFile -> IO () -indexHieFile se mod_summary srcPath hash hf = do +indexHieFile se mod_summary srcPath !hash hf = do IdeOptions{optProgressStyle} <- getIdeOptionsIO se atomically $ do pending <- readTVar indexPending case HashMap.lookup srcPath pending of Just pendingHash | pendingHash == hash -> pure () -- An index is already scheduled _ -> do + -- hiedb doesn't use the Haskell src, so we clear it to avoid unnecessarily keeping it around + let !hf' = hf{hie_hs_src = mempty} modifyTVar' indexPending $ HashMap.insert srcPath hash writeTQueue indexQueue $ \db -> do -- We are now in the worker thread @@ -547,7 +549,7 @@ indexHieFile se mod_summary srcPath hash hf = do Just pendingHash -> pendingHash /= hash unless newerScheduled $ do pre optProgressStyle - addRefsFromLoaded db targetPath (RealFile $ fromNormalizedFilePath srcPath) hash hf + addRefsFromLoaded db targetPath (RealFile $ fromNormalizedFilePath srcPath) hash hf' post where mod_location = ms_location mod_summary