@@ -474,31 +474,33 @@ spliceExpresions Splices{..} =
474474 ]
475475
476476-- | 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
478478-- progress.
479479--
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
483484--
484485-- Otherwise, we record the current file as pending and write an indexing
485486-- operation to the queue
486487--
487488-- 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
490491-- scheduled, we can safely skip this one
491492--
492493-- Otherwise, we start or continue a progress reporting session, telling it
493494-- about progress so far and the current file we are attempting to index. Then
494495-- we can go ahead and call in to hiedb to actually do the indexing operation
495496--
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
497498-- must remove the just indexed file from 'indexPending' Then we check if
498499-- 'indexPending' is now empty. In that case, we end the progress session and
499500-- report the total number of file indexed. We also set the 'indexCompleted'
500501-- TVar to 0 in order to set it up for a fresh indexing session. Otherwise, we
501502-- can just increment the 'indexCompleted' TVar and exit.
503+ --
502504indexHieFile :: ShakeExtras -> ModSummary -> NormalizedFilePath -> Fingerprint -> Compat. HieFile -> IO ()
503505indexHieFile se mod_summary srcPath hash hf = atomically $ do
504506 pending <- readTVar indexPending
0 commit comments