Matthew Pickering pushed to branch wip/with-hs-doc-identifiers-determ at Glasgow Haskell Compiler / GHC
Commits:
-
fa45b63d
by Matthew Pickering at 2026-02-04T14:28:34+00:00
4 changed files:
- compiler/GHC/Hs/Doc.hs
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
Changes:
| ... | ... | @@ -45,6 +45,7 @@ import qualified GHC.Utils.Outputable as O |
| 45 | 45 | import GHC.Hs.Extension
|
| 46 | 46 | import GHC.Types.Unique.Map
|
| 47 | 47 | import Data.List (sortBy)
|
| 48 | +import Data.Function
|
|
| 48 | 49 | |
| 49 | 50 | import GHC.Hs.DocString
|
| 50 | 51 | |
| ... | ... | @@ -83,7 +84,7 @@ instance Outputable a => Outputable (WithHsDocIdentifiers a pass) where |
| 83 | 84 | instance Binary a => Binary (WithHsDocIdentifiers a GhcRn) where
|
| 84 | 85 | put_ bh (WithHsDocIdentifiers s ids) = do
|
| 85 | 86 | put_ bh s
|
| 86 | - put_ bh $ BinLocated <$> ids
|
|
| 87 | + put_ bh $ BinLocated <$> (sortBy (stableNameCmp `on` getName) ids)
|
|
| 87 | 88 | get bh =
|
| 88 | 89 | liftA2 WithHsDocIdentifiers (get bh) (fmap unBinLocated <$> get bh)
|
| 89 | 90 |
| ... | ... | @@ -6,14 +6,14 @@ docs: |
| 6 | 6 | '<>', ':=:', 'Bool'
|
| 7 | 7 | -}
|
| 8 | 8 | identifiers:
|
| 9 | + {DocsInHiFile.hs:4:2-3}
|
|
| 10 | + GHC.Internal.Base.<>
|
|
| 9 | 11 | {DocsInHiFile.hs:2:6-9}
|
| 10 | 12 | GHC.Internal.Data.Foldable.elem
|
| 11 | - {DocsInHiFile.hs:2:6-9}
|
|
| 12 | - elem
|
|
| 13 | 13 | {DocsInHiFile.hs:2:14-18}
|
| 14 | 14 | GHC.Internal.System.IO.print
|
| 15 | - {DocsInHiFile.hs:4:2-3}
|
|
| 16 | - GHC.Internal.Base.<>
|
|
| 15 | + {DocsInHiFile.hs:2:6-9}
|
|
| 16 | + elem
|
|
| 17 | 17 | {DocsInHiFile.hs:4:15-18}
|
| 18 | 18 | GHC.Internal.Types.Bool
|
| 19 | 19 | export docs:
|
| ... | ... | @@ -6,14 +6,14 @@ docs: |
| 6 | 6 | '<>', ':=:', 'Bool'
|
| 7 | 7 | -}
|
| 8 | 8 | identifiers:
|
| 9 | + {HaddockSpanIssueT24378.hs:3:2-3}
|
|
| 10 | + GHC.Internal.Base.<>
|
|
| 9 | 11 | {HaddockSpanIssueT24378.hs:1:6-9}
|
| 10 | 12 | GHC.Internal.Data.Foldable.elem
|
| 11 | - {HaddockSpanIssueT24378.hs:1:6-9}
|
|
| 12 | - elem
|
|
| 13 | 13 | {HaddockSpanIssueT24378.hs:1:14-18}
|
| 14 | 14 | GHC.Internal.System.IO.print
|
| 15 | - {HaddockSpanIssueT24378.hs:3:2-3}
|
|
| 16 | - GHC.Internal.Base.<>
|
|
| 15 | + {HaddockSpanIssueT24378.hs:1:6-9}
|
|
| 16 | + elem
|
|
| 17 | 17 | {HaddockSpanIssueT24378.hs:3:15-18}
|
| 18 | 18 | GHC.Internal.Types.Bool
|
| 19 | 19 | export docs:
|
| ... | ... | @@ -3,10 +3,10 @@ docs: |
| 3 | 3 | Just text:
|
| 4 | 4 | -- | 'foo#' `Bar##` `*##`
|
| 5 | 5 | identifiers:
|
| 6 | - {MagicHashInHaddocks.hs:3:7-10}
|
|
| 7 | - foo#
|
|
| 8 | 6 | {MagicHashInHaddocks.hs:3:14-18}
|
| 9 | 7 | Bar##
|
| 8 | + {MagicHashInHaddocks.hs:3:7-10}
|
|
| 9 | + foo#
|
|
| 10 | 10 | export docs:
|
| 11 | 11 | []
|
| 12 | 12 | declaration docs:
|