@@ -157,7 +157,9 @@ run scheduler _origDir plugins captureFp = flip E.catches handlers $ do
157
157
158
158
-- Check for mismatching GHC versions
159
159
-- Ignore hie.yaml parse errors. They get reported in ModuleCache.hs
160
- let parseErrorHandler (_ :: Yaml. ParseException ) = return Nothing
160
+ let parseErrorHandler (_ :: Yaml. ParseException ) = do
161
+ logm " Caught a yaml parse exception"
162
+ return Nothing
161
163
dummyCradleFile = fromMaybe currentDir lspRootDir </> " File.hs"
162
164
logm $ " Dummy Cradle File: " ++ dummyCradleFile
163
165
mcradle <- liftIO $ E. catch (Just <$> findLocalCradle dummyCradleFile) parseErrorHandler
@@ -411,13 +413,12 @@ reactor inp diagIn = do
411
413
currentDir <- liftIO getCurrentDirectory
412
414
413
415
-- Check for mismatching GHC versions
414
- -- Ignore hie.yaml parse errors. They get reported in ModuleCache.hs
415
- let parseErrorHandler (_ :: Yaml. ParseException ) = return Nothing
416
- dummyCradleFile = (fromMaybe currentDir lspRootDir) </> " File.hs"
417
- cradleRes <- liftIO $ E. catch (Just <$> findLocalCradle dummyCradleFile) parseErrorHandler
416
+ let dummyCradleFile = (fromMaybe currentDir lspRootDir) </> " File.hs"
417
+ logm $ " Dummy Cradle file result: " ++ dummyCradleFile
418
+ cradleRes <- liftIO $ E. try (findLocalCradle dummyCradleFile)
418
419
419
420
case cradleRes of
420
- Just cradle -> do
421
+ Right cradle -> do
421
422
projGhcVersion <- liftIO $ getProjectGhcVersion cradle
422
423
when (projGhcVersion /= hieGhcVersion) $ do
423
424
let msg = T. pack $ " Mismatching GHC versions: " ++ cradleDisplay cradle ++
@@ -434,7 +435,9 @@ reactor inp diagIn = do
434
435
reactorSend $ NotShowMessage $ fmServerShowMessageNotification J. MtWarning cabalMsg
435
436
reactorSend $ NotLogMessage $ fmServerLogMessageNotification J. MtWarning cabalMsg
436
437
437
- Nothing -> return ()
438
+ Left (_ :: Yaml. ParseException ) -> do
439
+ logm " Failed to parse it"
440
+ reactorSend $ NotShowMessage $ fmServerShowMessageNotification J. MtError " Couldn't parse hie.yaml"
438
441
439
442
renv <- ask
440
443
let hreq = GReq tn " init-hoogle" Nothing Nothing Nothing callback Nothing $ IdeResultOk <$> Hoogle. initializeHoogleDb
0 commit comments