diff --git a/ghcide/src/Development/IDE/Spans/Documentation.hs b/ghcide/src/Development/IDE/Spans/Documentation.hs index e3fed96d48..ab9d82695b 100644 --- a/ghcide/src/Development/IDE/Spans/Documentation.hs +++ b/ghcide/src/Development/IDE/Spans/Documentation.hs @@ -26,7 +26,9 @@ getDocumentationTryGhc => [TypecheckedModule] -> Name -> m SpanDoc -#if MIN_GHC_API_VERSION(8,6,0) +-- getDocs goes through the GHCi codepaths which cause problems on ghc-lib. +-- See https://github.com/digital-asset/daml/issues/4152 for more details. +#if MIN_GHC_API_VERSION(8,6,0) && !defined(GHC_LIB) getDocumentationTryGhc tcs name = do res <- catchSrcErrors "docs" $ getDocs name case res of @@ -108,4 +110,4 @@ docHeaders = mapMaybe (\(L _ x) -> wrk x) AnnLineComment s -> if "-- |" `isPrefixOf` s then Just $ T.pack s else Nothing - _ -> Nothing \ No newline at end of file + _ -> Nothing