Skip to content

Commit 4018b68

Browse files
Fix crash for non-LSP modes wrt #2627 (#2719)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent f1e146b commit 4018b68

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: ghcide/src/Development/IDE/Core/Rules.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,10 @@ instance IsIdeGlobal DisplayTHWarning
839839

840840
getModSummaryRule :: Rules ()
841841
getModSummaryRule = do
842-
env <- lspEnv <$> getShakeExtrasRules
843-
displayItOnce <- liftIO $ once $ LSP.runLspT (fromJust env) displayTHWarning
844-
addIdeGlobal (DisplayTHWarning displayItOnce)
842+
menv <- lspEnv <$> getShakeExtrasRules
843+
forM_ menv $ \env -> do
844+
displayItOnce <- liftIO $ once $ LSP.runLspT env displayTHWarning
845+
addIdeGlobal (DisplayTHWarning displayItOnce)
845846

846847
defineEarlyCutoff $ Rule $ \GetModSummary f -> do
847848
session' <- hscEnv <$> use_ GhcSession f

0 commit comments

Comments
 (0)