mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-15 04:43:41 +03:00
Expose TcModuleResult in RuleTypes (#2014)
This should really be part of the public API.
This commit is contained in:
parent
5beb77cdb0
commit
1a7d83c7e8
@ -16,10 +16,11 @@ module Development.IDE.Core.Compile
|
||||
, addRelativeImport
|
||||
) where
|
||||
|
||||
import Development.IDE.GHC.Warnings
|
||||
import Development.IDE.Core.RuleTypes
|
||||
import Development.IDE.GHC.CPP
|
||||
import Development.IDE.Types.Diagnostics
|
||||
import Development.IDE.GHC.Error
|
||||
import Development.IDE.GHC.Warnings
|
||||
import Development.IDE.Types.Diagnostics
|
||||
import Development.IDE.GHC.Orphans()
|
||||
import Development.IDE.GHC.Util
|
||||
import Development.IDE.GHC.Compat
|
||||
@ -42,7 +43,6 @@ import StringBuffer as SB
|
||||
import TidyPgm
|
||||
import qualified GHC.LanguageExtensions as LangExt
|
||||
|
||||
import Control.DeepSeq
|
||||
import Control.Monad.Extra
|
||||
import Control.Monad.Except
|
||||
import Control.Monad.Trans.Except
|
||||
@ -57,20 +57,6 @@ import System.Directory
|
||||
import System.IO.Extra
|
||||
import Data.Char
|
||||
|
||||
|
||||
-- | Contains the typechecked module and the OrigNameCache entry for
|
||||
-- that module.
|
||||
data TcModuleResult = TcModuleResult
|
||||
{ tmrModule :: TypecheckedModule
|
||||
, tmrModInfo :: HomeModInfo
|
||||
}
|
||||
instance Show TcModuleResult where
|
||||
show = show . pm_mod_summary . tm_parsed_module . tmrModule
|
||||
|
||||
instance NFData TcModuleResult where
|
||||
rnf = rwhnf
|
||||
|
||||
|
||||
-- | Given a string buffer, return a pre-processed @ParsedModule@.
|
||||
parseModule
|
||||
:: IdeOptions
|
||||
|
@ -12,7 +12,6 @@ module Development.IDE.Core.RuleTypes(
|
||||
) where
|
||||
|
||||
import Control.DeepSeq
|
||||
import Development.IDE.Core.Compile (TcModuleResult)
|
||||
import Development.IDE.Import.FindImports (Import(..))
|
||||
import Development.IDE.Import.DependencyInformation
|
||||
import Data.Hashable
|
||||
@ -21,6 +20,7 @@ import Development.Shake hiding (Env, newCache)
|
||||
import GHC.Generics (Generic)
|
||||
|
||||
import GHC
|
||||
import HscTypes (HomeModInfo)
|
||||
import Development.IDE.GHC.Compat
|
||||
|
||||
import Development.IDE.Spans.Type
|
||||
@ -42,6 +42,18 @@ type instance RuleResult GetDependencyInformation = DependencyInformation
|
||||
-- This rule is also responsible for calling ReportImportCycles for each file in the transitive closure.
|
||||
type instance RuleResult GetDependencies = TransitiveDependencies
|
||||
|
||||
-- | Contains the typechecked module and the OrigNameCache entry for
|
||||
-- that module.
|
||||
data TcModuleResult = TcModuleResult
|
||||
{ tmrModule :: TypecheckedModule
|
||||
, tmrModInfo :: HomeModInfo
|
||||
}
|
||||
instance Show TcModuleResult where
|
||||
show = show . pm_mod_summary . tm_parsed_module . tmrModule
|
||||
|
||||
instance NFData TcModuleResult where
|
||||
rnf = rwhnf
|
||||
|
||||
-- | The type checked version of this file, requires TypeCheck+
|
||||
type instance RuleResult TypeCheck = TcModuleResult
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user