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