@@ -14,18 +14,13 @@ module Development.IDE.Core.OfInterest(
1414 ) where
1515
1616import Control.Concurrent.Strict
17- import Control.DeepSeq
18- import Control.Exception
1917import Control.Monad
2018import Control.Monad.IO.Class
2119import Data.Binary
2220import Data.HashMap.Strict (HashMap )
2321import qualified Data.HashMap.Strict as HashMap
24- import Data.Hashable
2522import qualified Data.Text as T
26- import Data.Typeable
2723import Development.IDE.Graph
28- import GHC.Generics
2924
3025import Control.Monad.Trans.Class
3126import Control.Monad.Trans.Maybe
@@ -44,24 +39,15 @@ import Development.IDE.Types.Options
4439newtype OfInterestVar = OfInterestVar (Var (HashMap NormalizedFilePath FileOfInterestStatus ))
4540instance IsIdeGlobal OfInterestVar
4641
47- type instance RuleResult GetFilesOfInterest = HashMap NormalizedFilePath FileOfInterestStatus
48-
49- data GetFilesOfInterest = GetFilesOfInterest
50- deriving (Eq , Show , Typeable , Generic )
51- instance Hashable GetFilesOfInterest
52- instance NFData GetFilesOfInterest
53- instance Binary GetFilesOfInterest
54-
55-
5642-- | The rule that initialises the files of interest state.
5743ofInterestRules :: Rules ()
5844ofInterestRules = do
5945 addIdeGlobal . OfInterestVar =<< liftIO (newVar HashMap. empty)
60- defineEarlyCutoff $ RuleNoDiagnostics $ \ GetFilesOfInterest _file -> assert ( null $ fromNormalizedFilePath _file) $ do
46+ defineEarlyCutOffNoFile $ \ GetFilesOfInterest -> do
6147 alwaysRerun
6248 filesOfInterest <- getFilesOfInterestUntracked
6349 let ! cutoff = LBS. toStrict $ encode $ HashMap. toList filesOfInterest
64- pure (Just cutoff, Just filesOfInterest)
50+ pure (cutoff, filesOfInterest)
6551
6652-- | Get the files that are open in the IDE.
6753getFilesOfInterest :: Action (HashMap NormalizedFilePath FileOfInterestStatus )
0 commit comments