From f1f94f2f634fb065f69ca2cc87a4a54f4e3a39ed Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Fri, 30 Aug 2013 06:05:51 +0100 Subject: Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs --- src/Haddock/Types.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Haddock/Types.hs') diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 27a6201f..f90e5496 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -3,8 +3,9 @@ ----------------------------------------------------------------------------- -- | -- Module : Haddock.Types --- Copyright : (c) Simon Marlow 2003-2006, --- David Waern 2006-2009 +-- Copyright : (c) Simon Marlow 2003-2006, +-- David Waern 2006-2009, +-- Mateusz Kowalczyk 2013 -- License : BSD-like -- -- Maintainer : haddock@projects.haskellorg @@ -28,6 +29,7 @@ import Data.Typeable import Data.Map (Map) import qualified Data.Map as Map import GHC hiding (NoLink) +import DynFlags (ExtensionFlag, Language) import OccName import Control.Applicative (Applicative(..)) import Control.Monad (ap) @@ -422,6 +424,8 @@ data HaddockModInfo name = HaddockModInfo , hmi_stability :: Maybe String , hmi_portability :: Maybe String , hmi_safety :: Maybe String + , hmi_language :: Maybe Language + , hmi_extensions :: [ExtensionFlag] } @@ -434,6 +438,8 @@ emptyHaddockModInfo = HaddockModInfo , hmi_stability = Nothing , hmi_portability = Nothing , hmi_safety = Nothing + , hmi_language = Nothing + , hmi_extensions = [] } @@ -450,6 +456,7 @@ data DocOption | OptIgnoreExports -- ^ Pretend everything is exported. | OptNotHome -- ^ Not the best place to get docs for things -- exported by this module. + | OptShowExtensions -- ^ Render enabled extensions for this module. deriving (Eq, Show) -- cgit v1.2.3