@@ -29,7 +29,7 @@ import Development.IDE.GHC.Compat.Util
29
29
import Development.IDE.GHC.CoreFile
30
30
import Development.IDE.GHC.Util
31
31
import Development.IDE.Graph
32
- import Development.IDE.Graph.Internal.RuleInput (Input (ProjectHaskellFile , DependencyHaskellFile , NoFile ), RuleInput )
32
+ import Development.IDE.Graph.Internal.RuleInput (Input (ProjectHaskellFile , DependencyHaskellFile , NoFile ), RuleInput , ValidInputs ( ProjectHaskellFilesOnly , AllHaskellFiles , NoFiles ) )
33
33
import Development.IDE.Import.DependencyInformation
34
34
import Development.IDE.Types.HscEnvEq (HscEnvEq )
35
35
import Development.IDE.Types.KnownTargets
@@ -66,34 +66,34 @@ encodeLinkableType (Just ObjectLinkable) = "2"
66
66
67
67
-- | The parse tree for the file using GetFileContents
68
68
type instance RuleResult GetParsedModule = ParsedModule
69
- type instance RuleInput GetParsedModule = '[ ProjectHaskellFile , DependencyHaskellFile ]
69
+ type instance RuleInput GetParsedModule = AllHaskellFiles
70
70
71
71
-- | The parse tree for the file using GetFileContents,
72
72
-- all comments included using Opt_KeepRawTokenStream
73
73
type instance RuleResult GetParsedModuleWithComments = ParsedModule
74
- type instance RuleInput GetParsedModuleWithComments = '[ ProjectHaskellFile , DependencyHaskellFile ]
74
+ type instance RuleInput GetParsedModuleWithComments = AllHaskellFiles
75
75
76
76
type instance RuleResult GetModuleGraph = DependencyInformation
77
- type instance RuleInput GetModuleGraph = '[ ProjectHaskellFile ]
77
+ type instance RuleInput GetModuleGraph = ProjectHaskellFilesOnly
78
78
79
79
data GetKnownTargets = GetKnownTargets
80
80
deriving (Show , Generic , Eq , Ord )
81
81
instance Hashable GetKnownTargets
82
82
instance NFData GetKnownTargets
83
83
type instance RuleResult GetKnownTargets = KnownTargets
84
- type instance RuleInput GetKnownTargets = '[ NoFile ]
84
+ type instance RuleInput GetKnownTargets = NoFiles
85
85
86
86
-- | Convert to Core, requires TypeCheck*
87
87
type instance RuleResult GenerateCore = ModGuts
88
- type instance RuleInput GenerateCore = '[ ProjectHaskellFile ]
88
+ type instance RuleInput GenerateCore = ProjectHaskellFilesOnly
89
89
90
90
data GenerateCore = GenerateCore
91
91
deriving (Eq , Show , Typeable , Generic )
92
92
instance Hashable GenerateCore
93
93
instance NFData GenerateCore
94
94
95
95
type instance RuleResult GetLinkable = LinkableResult
96
- type instance RuleInput GetLinkable = '[ ProjectHaskellFile ]
96
+ type instance RuleInput GetLinkable = ProjectHaskellFilesOnly
97
97
98
98
data LinkableResult
99
99
= LinkableResult
@@ -119,7 +119,7 @@ instance Hashable GetImportMap
119
119
instance NFData GetImportMap
120
120
121
121
type instance RuleResult GetImportMap = ImportMap
122
- type instance RuleInput GetImportMap = '[ ProjectHaskellFile ]
122
+ type instance RuleInput GetImportMap = ProjectHaskellFilesOnly
123
123
newtype ImportMap = ImportMap
124
124
{ importMap :: M. Map ModuleName NormalizedFilePath -- ^ Where are the modules imported by this file located?
125
125
} deriving stock Show
@@ -240,15 +240,15 @@ instance Show HieAstResult where
240
240
241
241
-- | The type checked version of this file, requires TypeCheck+
242
242
type instance RuleResult TypeCheck = TcModuleResult
243
- type instance RuleInput TypeCheck = '[ ProjectHaskellFile ]
243
+ type instance RuleInput TypeCheck = ProjectHaskellFilesOnly
244
244
245
245
-- | The uncompressed HieAST
246
246
type instance RuleResult GetHieAst = HieAstResult
247
- type instance RuleInput GetHieAst = '[ ProjectHaskellFile , DependencyHaskellFile ]
247
+ type instance RuleInput GetHieAst = AllHaskellFiles
248
248
249
249
-- | A IntervalMap telling us what is in scope at each point
250
250
type instance RuleResult GetBindings = Bindings
251
- type instance RuleInput GetBindings = '[ ProjectHaskellFile ]
251
+ type instance RuleInput GetBindings = ProjectHaskellFilesOnly
252
252
253
253
data DocAndTyThingMap = DKMap { getDocMap :: ! DocMap , getTyThingMap :: ! TyThingMap }
254
254
instance NFData DocAndTyThingMap where
@@ -258,50 +258,50 @@ instance Show DocAndTyThingMap where
258
258
show = const " docmap"
259
259
260
260
type instance RuleResult GetDocMap = DocAndTyThingMap
261
- type instance RuleInput GetDocMap = '[ ProjectHaskellFile ]
261
+ type instance RuleInput GetDocMap = ProjectHaskellFilesOnly
262
262
263
263
-- | A GHC session that we reuse.
264
264
type instance RuleResult GhcSession = HscEnvEq
265
- type instance RuleInput GhcSession = '[ ProjectHaskellFile ]
265
+ type instance RuleInput GhcSession = ProjectHaskellFilesOnly
266
266
267
267
-- | A GHC session preloaded with all the dependencies
268
268
-- This rule is also responsible for calling ReportImportCycles for the direct dependencies
269
269
type instance RuleResult GhcSessionDeps = HscEnvEq
270
- type instance RuleInput GhcSessionDeps = '[ ProjectHaskellFile ]
270
+ type instance RuleInput GhcSessionDeps = ProjectHaskellFilesOnly
271
271
272
272
-- | Resolve the imports in a module to the file path of a module in the same package
273
273
type instance RuleResult GetLocatedImports = [(Located ModuleName , Maybe ArtifactsLocation )]
274
- type instance RuleInput GetLocatedImports = '[ ProjectHaskellFile ]
274
+ type instance RuleInput GetLocatedImports = ProjectHaskellFilesOnly
275
275
276
276
-- | This rule is used to report import cycles. It depends on GetModuleGraph.
277
277
-- We cannot report the cycles directly from GetModuleGraph since
278
278
-- we can only report diagnostics for the current file.
279
279
type instance RuleResult ReportImportCycles = ()
280
- type instance RuleInput ReportImportCycles = '[ ProjectHaskellFile ]
280
+ type instance RuleInput ReportImportCycles = ProjectHaskellFilesOnly
281
281
282
282
-- | Read the module interface file from disk. Throws an error for VFS files.
283
283
-- This is an internal rule, use 'GetModIface' instead.
284
284
type instance RuleResult GetModIfaceFromDisk = HiFileResult
285
- type instance RuleInput GetModIfaceFromDisk = '[ ProjectHaskellFile ]
285
+ type instance RuleInput GetModIfaceFromDisk = ProjectHaskellFilesOnly
286
286
287
287
-- | GetModIfaceFromDisk and index the `.hie` file into the database.
288
288
-- This is an internal rule, use 'GetModIface' instead.
289
289
type instance RuleResult GetModIfaceFromDiskAndIndex = HiFileResult
290
- type instance RuleInput GetModIfaceFromDiskAndIndex = '[ ProjectHaskellFile ]
290
+ type instance RuleInput GetModIfaceFromDiskAndIndex = ProjectHaskellFilesOnly
291
291
292
292
-- | Get a module interface details, either from an interface file or a typechecked module
293
293
type instance RuleResult GetModIface = HiFileResult
294
- type instance RuleInput GetModIface = '[ ProjectHaskellFile , DependencyHaskellFile ]
294
+ type instance RuleInput GetModIface = AllHaskellFiles
295
295
296
296
-- | Get the contents of a file, either dirty (if the buffer is modified) or Nothing to mean use from disk.
297
297
type instance RuleResult GetFileContents = (FileVersion , Maybe Text )
298
- type instance RuleInput GetFileContents = '[ ProjectHaskellFile , DependencyHaskellFile ]
298
+ type instance RuleInput GetFileContents = AllHaskellFiles
299
299
300
300
type instance RuleResult GetFileExists = Bool
301
- type instance RuleInput GetFileExists = '[ ProjectHaskellFile , DependencyHaskellFile ]
301
+ type instance RuleInput GetFileExists = AllHaskellFiles
302
302
303
303
type instance RuleResult AddWatchedFile = Bool
304
- type instance RuleInput AddWatchedFile = '[ ProjectHaskellFile ]
304
+ type instance RuleInput AddWatchedFile = ProjectHaskellFilesOnly
305
305
306
306
307
307
-- The Shake key type for getModificationTime queries
@@ -331,7 +331,7 @@ pattern GetModificationTime = GetModificationTime_ {missingFileDiagnostics=True}
331
331
332
332
-- | Get the modification time of a file.
333
333
type instance RuleResult GetModificationTime = FileVersion
334
- type instance RuleInput GetModificationTime = '[ ProjectHaskellFile , DependencyHaskellFile ]
334
+ type instance RuleInput GetModificationTime = AllHaskellFiles
335
335
336
336
-- | Either the mtime from disk or an LSP version
337
337
-- LSP versions always compare as greater than on disk versions
@@ -374,7 +374,7 @@ instance Hashable IsFileOfInterestResult
374
374
instance NFData IsFileOfInterestResult
375
375
376
376
type instance RuleResult IsFileOfInterest = IsFileOfInterestResult
377
- type instance RuleInput IsFileOfInterest = '[ ProjectHaskellFile , DependencyHaskellFile ]
377
+ type instance RuleInput IsFileOfInterest = AllHaskellFiles
378
378
379
379
data ModSummaryResult = ModSummaryResult
380
380
{ msrModSummary :: ! ModSummary
@@ -397,11 +397,11 @@ instance NFData ModSummaryResult where
397
397
-- | Generate a ModSummary that has enough information to be used to get .hi and .hie files.
398
398
-- without needing to parse the entire source
399
399
type instance RuleResult GetModSummary = ModSummaryResult
400
- type instance RuleInput GetModSummary = '[ ProjectHaskellFile , DependencyHaskellFile ]
400
+ type instance RuleInput GetModSummary = AllHaskellFiles
401
401
402
402
-- | Generate a ModSummary with the timestamps and preprocessed content elided, for more successful early cutoff
403
403
type instance RuleResult GetModSummaryWithoutTimestamps = ModSummaryResult
404
- type instance RuleInput GetModSummaryWithoutTimestamps = '[ ProjectHaskellFile , DependencyHaskellFile ]
404
+ type instance RuleInput GetModSummaryWithoutTimestamps = AllHaskellFiles
405
405
406
406
data GetParsedModule = GetParsedModule
407
407
deriving (Eq , Show , Typeable , Generic )
@@ -420,7 +420,7 @@ instance NFData GetLocatedImports
420
420
421
421
-- | Does this module need to be compiled?
422
422
type instance RuleResult NeedsCompilation = Maybe LinkableType
423
- type instance RuleInput NeedsCompilation = '[ ProjectHaskellFile ]
423
+ type instance RuleInput NeedsCompilation = ProjectHaskellFilesOnly
424
424
425
425
data NeedsCompilation = NeedsCompilation
426
426
deriving (Eq , Show , Typeable , Generic )
@@ -514,7 +514,7 @@ instance Hashable GetClientSettings
514
514
instance NFData GetClientSettings
515
515
516
516
type instance RuleResult GetClientSettings = Hashed (Maybe Value )
517
- type instance RuleInput GetClientSettings = '[ NoFile ]
517
+ type instance RuleInput GetClientSettings = NoFiles
518
518
519
519
data AddWatchedFile = AddWatchedFile deriving (Eq , Show , Typeable , Generic )
520
520
instance Hashable AddWatchedFile
@@ -525,7 +525,7 @@ instance NFData AddWatchedFile
525
525
-- thread killed exception issues, so we lift it to a full rule.
526
526
-- https://github.com/digital-asset/daml/pull/2808#issuecomment-529639547
527
527
type instance RuleResult GhcSessionIO = IdeGhcSession
528
- type instance RuleInput GhcSessionIO = '[ ProjectHaskellFile ]
528
+ type instance RuleInput GhcSessionIO = ProjectHaskellFilesOnly
529
529
530
530
data IdeGhcSession = IdeGhcSession
531
531
{ loadSessionFun :: FilePath -> IO (IdeResult HscEnvEq , [FilePath ])
0 commit comments