2
2
module Development.IDE.GHC.Dump (showAstDataHtml ) where
3
3
import Data.Data hiding (Fixity )
4
4
import Development.IDE.GHC.Compat hiding (NameAnn )
5
+ import Development.IDE.GHC.ExactPrint hiding (NameAnn )
5
6
#if MIN_VERSION_ghc(8,10,1)
6
7
import GHC.Hs.Dump
7
8
#else
@@ -21,18 +22,18 @@ import GhcPlugins
21
22
import Prelude hiding ((<>) )
22
23
23
24
-- | Show a GHC syntax tree in HTML.
25
+ #if MIN_VERSION_ghc(9,2,1)
26
+ showAstDataHtml :: (Data a , ExactPrint a , Outputable a ) => a -> SDoc
27
+ #else
24
28
showAstDataHtml :: (Data a , Outputable a ) => a -> SDoc
29
+ #endif
25
30
showAstDataHtml a0 = html $
26
31
header $$
27
32
body (tag' [(" id" ,text (show @ String " myUL" ))] " ul" $ vcat
28
33
[
29
- -- #if MIN_VERSION_ghc(9,2,1)
30
-
31
- -- #else
32
34
#if MIN_VERSION_ghc(9,2,1)
33
- -- li (pre $ text (exactPrint a0)),
34
- -- li (showAstDataHtml' a0),
35
- -- li (nested "Raw" $ pre $ showAstData NoBlankSrcSpan NoBlankEpAnnotations a0)
35
+ li (pre $ text (exactPrint a0)),
36
+ li (showAstDataHtml' a0),
36
37
li (nested " Raw" $ pre $ showAstData NoBlankSrcSpan NoBlankEpAnnotations a0)
37
38
#else
38
39
li (nested " Raw" $ pre $ showAstData NoBlankSrcSpan a0)
@@ -56,7 +57,6 @@ showAstDataHtml a0 = html $
56
57
header = tag " head" $ tag " style" $ text css
57
58
html = tag " html"
58
59
pre = tag " pre"
59
- {-
60
60
#if MIN_VERSION_ghc(9,2,1)
61
61
showAstDataHtml' :: Data a => a -> SDoc
62
62
showAstDataHtml' =
@@ -282,7 +282,6 @@ showAstDataHtml a0 = html $
282
282
Nothing -> text " locatedAnn:unmatched" <+> tag
283
283
<+> (text (showConstr (toConstr ss)))
284
284
#endif
285
- -}
286
285
287
286
288
287
normalize_newlines :: String -> String
0 commit comments