on master help sign in
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

commit913aa5f9fa3508dcbe423aea3e0d0effe1b57d1b authorNeil Mitchell <ndmitchell@gmail.com> dateTue 28 Jan 2020, 19:20 (7 years ago) parentf695c50
6 files changed+4−14
ghcide.cabal+1−1 src/Development/IDE/Spans/Common.hs−9 stack-ghc-lib.yaml+1 stack.yaml+1 stack84.yaml+1 test/exe/Main.hs−4
ghcide.cabal+1−1
@@ -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−9
@@ -82,11 +82,7 @@ spanDocToMarkdown (SpanDocText txt) = txt
8282
8383spanDocToMarkdownForTest :: String -> String
8484spanDocToMarkdownForTest
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
9288haddockToMarkdown
@@ -127,13 +123,8 @@ haddockToMarkdown (H.DocExamples es)
127123 = ">>> " ++ expr ++ "\n" ++ unlines result
128124haddockToMarkdown (H.DocHyperlink (H.Hyperlink url Nothing))
129125 = "<" ++ url ++ ">"
130−#if MIN_VERSION_haddock_library(1,8,0)
131126haddockToMarkdown (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
137128haddockToMarkdown (H.DocPic (H.Picture url Nothing))
138129 = "![](" ++ url ++ ")"
139130haddockToMarkdown (H.DocPic (H.Picture url (Just label)))
stack-ghc-lib.yaml+1
@@ -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
1415nix:
1516 packages: [zlib]
1617flags:
stack.yaml+1
@@ -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
1415nix:
1516 packages: [zlib]
stack84.yaml+1
@@ -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
1819nix:
1920 packages: [zlib]
2021allow-newer: true
test/exe/Main.hs−4
@@ -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`"