From 9bbcd3859c9ea08b75e6964490e75236f4a73454 Mon Sep 17 00:00:00 2001
From: Alexis King <lexi.lambda@gmail.com>
Date: Mon, 30 Sep 2019 20:12:42 -0500
Subject: Fix the ignore-exports option (#1082)

The `ignore-exports` option has been broken since #688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it.
---
 html-test/Main.hs                |  6 -----
 html-test/ref/IgnoreExports.html | 54 ++++++++++++++++++++++++++++++++++------
 html-test/src/IgnoreExports.hs   |  5 +++-
 3 files changed, 51 insertions(+), 14 deletions(-)

(limited to 'html-test')

diff --git a/html-test/Main.hs b/html-test/Main.hs
index 26eefe4a..36e56d9a 100755
--- a/html-test/Main.hs
+++ b/html-test/Main.hs
@@ -54,12 +54,6 @@ ingoredTests =
     -- we need a reliable way to deduplicate here.
     -- Happens since PR #688.
     "B"
-
-    -- ignore-exports flag broke with PR #688. We use
-    -- the Avails calculated by GHC now. Probably
-    -- requires a change to GHC to "ignore" a modules
-    -- export list reliably.
-  , "IgnoreExports"
   ]
 
 checkIgnore :: FilePath -> Bool
diff --git a/html-test/ref/IgnoreExports.html b/html-test/ref/IgnoreExports.html
index eed12c00..8b3390ae 100644
--- a/html-test/ref/IgnoreExports.html
+++ b/html-test/ref/IgnoreExports.html
@@ -4,12 +4,14 @@
      /><meta name="viewport" content="width=device-width, initial-scale=1"
      /><title
     >IgnoreExports</title
-    ><link href="#" rel="stylesheet" type="text/css" title="Ocean"
+    ><link href="#" rel="stylesheet" type="text/css" title="Linuwial"
      /><link rel="stylesheet" type="text/css" href="#"
      /><link rel="stylesheet" type="text/css" href="#"
      /><script src="haddock-bundle.min.js" async="async" type="text/javascript"
     ></script
-    ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"
+    ><script type="text/x-mathjax-config"
+    >MathJax.Hub.Config({ tex2jax: { processClass: &quot;mathjax&quot;, ignoreClass: &quot;.*&quot; } });</script
+    ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"
     ></script
     ></head
   ><body
@@ -46,15 +48,23 @@
 	  >Synopsis</summary
 	  ><ul class="details-toggle" data-details-id="syn"
 	  ><li class="src short"
+	    ><span class="keyword"
+	      >data</span
+	      > <a href="#"
+	      >Foo</a
+	      > = <a href="#"
+	      >Bar</a
+	      ></li
+	    ><li class="src short"
 	    ><a href="#"
 	      >foo</a
-	      > :: <a href="#"
+	      > :: <a href="#" title="Data.Int"
 	      >Int</a
 	      ></li
 	    ><li class="src short"
 	    ><a href="#"
 	      >bar</a
-	      > :: <a href="#"
+	      > :: <a href="#" title="Data.Int"
 	      >Int</a
 	      ></li
 	    ></ul
@@ -64,10 +74,40 @@
       ><h1
 	>Documentation</h1
 	><div class="top"
+	><p class="src"
+	  ><span class="keyword"
+	    >data</span
+	    > <a id="t:Foo" class="def"
+	    >Foo</a
+	    > <a href="#" class="selflink"
+	    >#</a
+	    ></p
+	  ><div class="doc"
+	  ><p
+	    >documentation for Foo</p
+	    ></div
+	  ><div class="subs constructors"
+	  ><p class="caption"
+	    >Constructors</p
+	    ><table
+	    ><tr
+	      ><td class="src"
+		><a id="v:Bar" class="def"
+		  >Bar</a
+		  ></td
+		><td class="doc"
+		><p
+		  >Documentation for Bar</p
+		  ></td
+		></tr
+	      ></table
+	    ></div
+	  ></div
+	><div class="top"
 	><p class="src"
 	  ><a id="v:foo" class="def"
 	    >foo</a
-	    > :: <a href="#"
+	    > :: <a href="#" title="Data.Int"
 	    >Int</a
 	    > <a href="#" class="selflink"
 	    >#</a
@@ -81,7 +121,7 @@
 	><p class="src"
 	  ><a id="v:bar" class="def"
 	    >bar</a
-	    > :: <a href="#"
+	    > :: <a href="#" title="Data.Int"
 	    >Int</a
 	    > <a href="#" class="selflink"
 	    >#</a
@@ -97,4 +137,4 @@
     ></div
     ></body
   ></html
->
+>
\ No newline at end of file
diff --git a/html-test/src/IgnoreExports.hs b/html-test/src/IgnoreExports.hs
index 0321ad02..edb7c4c1 100644
--- a/html-test/src/IgnoreExports.hs
+++ b/html-test/src/IgnoreExports.hs
@@ -1,5 +1,8 @@
 {-# OPTIONS_HADDOCK ignore-exports #-}
-module IgnoreExports (foo) where
+module IgnoreExports (Foo, foo) where
+
+-- | documentation for Foo
+data Foo = Bar -- ^ Documentation for Bar
 
 -- | documentation for foo
 foo :: Int
-- 
cgit v1.2.3