Skip to content

Commit 913aa5f

Browse files
ndmitchellcocreature
authored andcommitted
Don't support old haddock-library versions (#375)
* Don't support old haddock-library versions * Update stack.yaml values * Remove some more haddock_library CPP * Make sure the latest haddock-library is on GHC 8.4
1 parent f695c50 commit 913aa5f

File tree

6 files changed

+4
-14
lines changed

6 files changed

+4
-14
lines changed

ghcide.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ library
4141
extra,
4242
fuzzy,
4343
filepath,
44-
haddock-library,
44+
haddock-library >= 1.8,
4545
hashable,
4646
haskell-lsp-types == 0.19.*,
4747
haskell-lsp == 0.19.*,

src/Development/IDE/Spans/Common.hs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ spanDocToMarkdown (SpanDocText txt) = txt
8282

8383
spanDocToMarkdownForTest :: String -> String
8484
spanDocToMarkdownForTest
85-
#if MIN_VERSION_haddock_library(1,6,0)
8685
= haddockToMarkdown . H.toRegular . H._doc . H.parseParas Nothing
87-
#else
88-
= haddockToMarkdown . H.toRegular . H._doc . H.parseParas
89-
#endif
9086

9187
-- Simple (and a bit hacky) conversion from Haddock markup to Markdown
9288
haddockToMarkdown
@@ -127,13 +123,8 @@ haddockToMarkdown (H.DocExamples es)
127123
= ">>> " ++ expr ++ "\n" ++ unlines result
128124
haddockToMarkdown (H.DocHyperlink (H.Hyperlink url Nothing))
129125
= "<" ++ url ++ ">"
130-
#if MIN_VERSION_haddock_library(1,8,0)
131126
haddockToMarkdown (H.DocHyperlink (H.Hyperlink url (Just label)))
132127
= "[" ++ haddockToMarkdown label ++ "](" ++ url ++ ")"
133-
#else
134-
haddockToMarkdown (H.DocHyperlink (H.Hyperlink url (Just label)))
135-
= "[" ++ label ++ "](" ++ url ++ ")"
136-
#endif
137128
haddockToMarkdown (H.DocPic (H.Picture url Nothing))
138129
= "![](" ++ url ++ ")"
139130
haddockToMarkdown (H.DocPic (H.Picture url (Just label)))

stack-ghc-lib.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extra-deps:
1111
- fuzzy-0.1.0.0
1212
- regex-base-0.94.0.0
1313
- regex-tdfa-1.3.1.0
14+
- haddock-library-1.8.0
1415
nix:
1516
packages: [zlib]
1617
flags:

stack.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ extra-deps:
1111
- regex-base-0.94.0.0
1212
- regex-tdfa-1.3.1.0
1313
- parser-combinators-1.2.1
14+
- haddock-library-1.8.0
1415
nix:
1516
packages: [zlib]

stack84.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extra-deps:
1515
- regex-base-0.94.0.0
1616
- regex-tdfa-1.3.1.0
1717
- parser-combinators-1.2.1
18+
- haddock-library-1.8.0
1819
nix:
1920
packages: [zlib]
2021
allow-newer: true

test/exe/Main.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,11 +1665,7 @@ haddockTests
16651665
(unlines
16661666
[ ""
16671667
, ""
1668-
#if MIN_VERSION_haddock_library(1,8,0)
16691668
, "However, `(+)` and `(*)` are"
1670-
#else
1671-
, "However, '(+)' and '(*)' are"
1672-
#endif
16731669
, "customarily expected to define a ring and have the following properties: "
16741670
, "+ ****Associativity of (+)****: `(x + y) + z` = `x + (y + z)`"
16751671
, "+ ****Commutativity of (+)****: `x + y` = `y + x`"

0 commit comments

Comments
 (0)