Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions ghcide/test/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5553,12 +5553,17 @@ bootTests = testGroup "boot"
-- Dirty the cache
liftIO $ runInDir dir $ do
cDoc <- createDoc cPath "haskell" cSource
_ <- getHover cDoc $ Position 4 3
~() <- skipManyTill anyMessage $ satisfyMaybe $ \case
FromServerMess (SCustomMethod "ghcide/reference/ready") (NotMess NotificationMessage{_params = fp}) -> do
A.Success fp' <- pure $ fromJSON fp
if equalFilePath fp' cPath then pure () else Nothing
_ -> Nothing
let hoverParams = HoverParams cDoc (Position 4 3) Nothing
hoverRequestId <- sendRequest STextDocumentHover hoverParams
inBetweenMsgs <- manyTill anyMessage (responseForId STextDocumentHover hoverRequestId)
let isReadyMsg = \case
FromServerMess (SCustomMethod "ghcide/reference/ready") (NotMess NotificationMessage{_params = params}) ->
case fromJSON params of
A.Success fp | equalFilePath fp cPath -> Just ()
_ -> Nothing
_ -> Nothing
when (not (any (isJust . isReadyMsg) inBetweenMsgs)) $
skipManyTill anyMessage $ satisfyMaybe isReadyMsg
closeDoc cDoc
cdoc <- createDoc cPath "haskell" cSource
locs <- getDefinitions cdoc (Position 7 4)
Expand Down