@@ -261,8 +261,6 @@ queryCalls :: (Show a)
261
261
-> Action (Maybe [a ])
262
262
queryCalls item queryFunc makeFunc merge
263
263
| Just nfp <- uriToNormalizedFilePath $ toNormalizedUri uri = do
264
- refreshHieDb
265
-
266
264
ShakeExtras {withHieDb} <- getShakeExtras
267
265
maySymbol <- getSymbol nfp
268
266
case maySymbol of
@@ -298,36 +296,3 @@ queryCalls item queryFunc makeFunc merge
298
296
Nothing -> pure Nothing
299
297
Just res -> pure res
300
298
Nothing -> pure Nothing
301
-
302
- -- Write modified foi files before queries.
303
- refreshHieDb :: Action ()
304
- refreshHieDb = do
305
- fs <- HM. keys . HM. filter (/= OnDisk ) <$> getFilesOfInterestUntracked
306
- forM_ fs (\ f -> do
307
- tmr <- use_ TypeCheck f
308
- hsc <- hscEnv <$> use_ GhcSession f
309
- (_, masts) <- liftIO $ generateHieAsts hsc tmr
310
- se <- getShakeExtras
311
- case masts of
312
- Nothing -> pure ()
313
- Just asts -> do
314
- source <- getSourceFileSource f
315
- let exports = tcg_exports $ tmrTypechecked tmr
316
- msum = tmrModSummary tmr
317
- liftIO $ writeAndIndexHieFile hsc se msum f exports asts source
318
- pure ()
319
- )
320
- ShakeExtras {hiedbWriter} <- getShakeExtras
321
- liftIO $ atomically $ check $ indexPending hiedbWriter
322
- where
323
- check p = do
324
- v <- readTVar p
325
- if HM. null v then pure () else retry
326
-
327
- -- Copy unexport function form `ghcide/src/Development/IDE/Core/Rules.hs`
328
- getSourceFileSource :: NormalizedFilePath -> Action BS. ByteString
329
- getSourceFileSource nfp = do
330
- (_, msource) <- getFileContents nfp
331
- case msource of
332
- Nothing -> liftIO $ BS. readFile (fromNormalizedFilePath nfp)
333
- Just source -> pure $ T. encodeUtf8 source
0 commit comments