@@ -474,31 +474,33 @@ spliceExpresions Splices{..} =
474
474
]
475
475
476
476
-- | In addition to indexing the `.hie` file, this function is reponsible for
477
- -- maintaining the IndexQueue state and notfiying the user about indexing
477
+ -- maintaining the ' IndexQueue' state and notfiying the user about indexing
478
478
-- progress.
479
479
--
480
- -- We maintain a record of all pending index operations in theh 'indexPending'
481
- -- TVar When 'indexHieFile' is called, it must check to ensure that the file
482
- -- hasn't already be queued up for indexing. If it has, then we can just skip it
480
+ -- We maintain a record of all pending index operations in the 'indexPending'
481
+ -- TVar.
482
+ -- When 'indexHieFile' is called, it must check to ensure that the file hasn't
483
+ -- already be queued up for indexing. If it has, then we can just skip it
483
484
--
484
485
-- Otherwise, we record the current file as pending and write an indexing
485
486
-- operation to the queue
486
487
--
487
488
-- When the indexing operation is picked up and executed by the worker thread,
488
- -- the first thing it does is ensure that a newer index for the same file
489
- -- hasn't been scheduled by looking at 'indexPending' If a newer index has been
489
+ -- the first thing it does is ensure that a newer index for the same file hasn't
490
+ -- been scheduled by looking at 'indexPending'. If a newer index has been
490
491
-- scheduled, we can safely skip this one
491
492
--
492
493
-- Otherwise, we start or continue a progress reporting session, telling it
493
494
-- about progress so far and the current file we are attempting to index. Then
494
495
-- we can go ahead and call in to hiedb to actually do the indexing operation
495
496
--
496
- -- Once this completes, we have to update the IndexQueue state First, we
497
+ -- Once this completes, we have to update the ' IndexQueue' state. First, we
497
498
-- must remove the just indexed file from 'indexPending' Then we check if
498
499
-- 'indexPending' is now empty. In that case, we end the progress session and
499
500
-- report the total number of file indexed. We also set the 'indexCompleted'
500
501
-- TVar to 0 in order to set it up for a fresh indexing session. Otherwise, we
501
502
-- can just increment the 'indexCompleted' TVar and exit.
503
+ --
502
504
indexHieFile :: ShakeExtras -> ModSummary -> NormalizedFilePath -> Fingerprint -> Compat. HieFile -> IO ()
503
505
indexHieFile se mod_summary srcPath hash hf = atomically $ do
504
506
pending <- readTVar indexPending
0 commit comments