Skip to content

Commit 8f74783

Browse files
authored
Disable getDocs call with ghc-lib (#342)
This has caused a bunch of issues in DAML where GHC seems to randomly panics when completions are requested, see digital-asset/daml#4152 for the error. I am not entirely sure what is going wrong there but `getDocs` also goes through the GHCi codepaths which are known to cause issues with ghc-lib so for now, let’s disable it.
1 parent 2154bb2 commit 8f74783

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Development/IDE/Spans/Documentation.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ getDocumentationTryGhc
2626
=> [TypecheckedModule]
2727
-> Name
2828
-> m SpanDoc
29-
#if MIN_GHC_API_VERSION(8,6,0)
29+
-- getDocs goes through the GHCi codepaths which cause problems on ghc-lib.
30+
-- See https://github.com/digital-asset/daml/issues/4152 for more details.
31+
#if MIN_GHC_API_VERSION(8,6,0) && !defined(GHC_LIB)
3032
getDocumentationTryGhc tcs name = do
3133
res <- catchSrcErrors "docs" $ getDocs name
3234
case res of
@@ -108,4 +110,4 @@ docHeaders = mapMaybe (\(L _ x) -> wrk x)
108110
AnnLineComment s -> if "-- |" `isPrefixOf` s
109111
then Just $ T.pack s
110112
else Nothing
111-
_ -> Nothing
113+
_ -> Nothing

0 commit comments

Comments
 (0)