@@ -39,7 +39,12 @@ mkDocMap
39
39
-> TcGblEnv
40
40
-> IO DocAndKindMap
41
41
mkDocMap env rm this_mod =
42
- do let (_ , DeclDocMap this_docs, _) = extractDocs this_mod
42
+ do
43
+ #if MIN_VERSION_ghc(9,2,0)
44
+ (_ , DeclDocMap this_docs, _) <- extractDocs this_mod
45
+ #else
46
+ let (_ , DeclDocMap this_docs, _) = extractDocs this_mod
47
+ #endif
43
48
d <- foldrM getDocs (mkNameEnv $ M. toList $ fmap (`SpanDocString ` SpanDocUris Nothing Nothing ) this_docs) names
44
49
k <- foldrM getType (tcg_type_env this_mod) names
45
50
pure $ DKMap d k
@@ -108,7 +113,12 @@ getDocumentation
108
113
-- may be edge cases where it is very wrong).
109
114
-- TODO : Build a version of GHC exactprint to extract this information
110
115
-- more accurately.
116
+ -- TODO : Implement this for GHC 9.2 with in-tree annotations
117
+ -- (alternatively, just remove it and rely soley on GHC's parsing)
111
118
getDocumentation sources targetName = fromMaybe [] $ do
119
+ #if MIN_VERSION_ghc(9,2,0)
120
+ Nothing
121
+ #else
112
122
-- Find the module the target is defined in.
113
123
targetNameSpan <- realSpan $ getLoc targetName
114
124
tc <-
@@ -170,6 +180,7 @@ docHeaders = mapMaybe (\(L _ x) -> wrk x)
170
180
then Just $ T. pack s
171
181
else Nothing
172
182
_ -> Nothing
183
+ #endif
173
184
174
185
-- These are taken from haskell-ide-engine's Haddock plugin
175
186
0 commit comments