@@ -14,18 +14,13 @@ module Development.IDE.Core.OfInterest(
14
14
) where
15
15
16
16
import Control.Concurrent.Strict
17
- import Control.DeepSeq
18
- import Control.Exception
19
17
import Control.Monad
20
18
import Control.Monad.IO.Class
21
19
import Data.Binary
22
20
import Data.HashMap.Strict (HashMap )
23
21
import qualified Data.HashMap.Strict as HashMap
24
- import Data.Hashable
25
22
import qualified Data.Text as T
26
- import Data.Typeable
27
23
import Development.IDE.Graph
28
- import GHC.Generics
29
24
30
25
import Control.Monad.Trans.Class
31
26
import Control.Monad.Trans.Maybe
@@ -44,24 +39,15 @@ import Development.IDE.Types.Options
44
39
newtype OfInterestVar = OfInterestVar (Var (HashMap NormalizedFilePath FileOfInterestStatus ))
45
40
instance IsIdeGlobal OfInterestVar
46
41
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
-
56
42
-- | The rule that initialises the files of interest state.
57
43
ofInterestRules :: Rules ()
58
44
ofInterestRules = do
59
45
addIdeGlobal . OfInterestVar =<< liftIO (newVar HashMap. empty)
60
- defineEarlyCutoff $ RuleNoDiagnostics $ \ GetFilesOfInterest _file -> assert ( null $ fromNormalizedFilePath _file) $ do
46
+ defineEarlyCutOffNoFile $ \ GetFilesOfInterest -> do
61
47
alwaysRerun
62
48
filesOfInterest <- getFilesOfInterestUntracked
63
49
let ! cutoff = LBS. toStrict $ encode $ HashMap. toList filesOfInterest
64
- pure (Just cutoff, Just filesOfInterest)
50
+ pure (cutoff, filesOfInterest)
65
51
66
52
-- | Get the files that are open in the IDE.
67
53
getFilesOfInterest :: Action (HashMap NormalizedFilePath FileOfInterestStatus )
0 commit comments