Expose TcModuleResult in RuleTypes (#2014)

This should really be part of the public API.
This commit is contained in:
Moritz Kiefer 2019-07-04 20:29:52 +02:00 committed by mergify[bot]
parent 399cab79be
commit ef9d27d80a
2 changed files with 18 additions and 20 deletions

View File

@ -16,10 +16,11 @@ module Development.IDE.Core.Compile
, addRelativeImport
) where
import Development.IDE.GHC.Warnings
import Development.IDE.GHC.CPP
import Development.IDE.Types.Diagnostics
import Development.IDE.GHC.Error
import Development.IDE.Core.RuleTypes
import Development.IDE.GHC.CPP
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

View File

@ -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