@@ -169,20 +169,20 @@ rules recorder plId = do
169169 relativeHsFilePath <- liftIO $ makeRelativeToCurrentDirectory $ fromNormalizedFilePath file
170170 let hieRelative = hie{hie_hs_file= relativeHsFilePath}
171171
172- (cabalExtensionsMap, checksMap, confIgnored ) <- case configTrial of
172+ (checksMap, ignoredObservations ) <- case configTrial of
173173 FiascoL es -> do
174174 logWith recorder Development.IDE. Warning (LogWarnConf es)
175- pure (Map. empty,
176- HM. fromList [(LSP. fromNormalizedFilePath file, inspectionsIds)],
177- [] )
178- ResultL warnings stanConfig -> do
179- -- A Map from *relative* file paths (just one, in this case) to language extension info.
180- cabalExtensionsMap <- liftIO $ createCabalExtensionsMap isLoud (stanArgsCabalFilePath stanArgs) [hieRelative]
175+ -- If we can't read the config file, default to using all inspections:
176+ let allInspections = HM. fromList [(relativeHsFilePath, inspectionsIds)]
177+ pure (allInspections, [] )
178+ ResultL _warnings stanConfig -> do
181179 -- HashMap of *relative* file paths to info about enabled checks for those file paths.
182180 let checksMap = applyConfig [relativeHsFilePath] stanConfig
183- pure (cabalExtensionsMap, checksMap, configIgnored stanConfig)
181+ pure (checksMap, configIgnored stanConfig)
184182
185- let analysis = runAnalysis cabalExtensionsMap checksMap confIgnored [hieRelative]
183+ -- A Map from *relative* file paths (just one, in this case) to language extension info:
184+ cabalExtensionsMap <- liftIO $ createCabalExtensionsMap isLoud (stanArgsCabalFilePath stanArgs) [hieRelative]
185+ let analysis = runAnalysis cabalExtensionsMap checksMap ignoredObservations [hieRelative]
186186 return (analysisToDiagnostics file analysis, Just () )
187187 else return ([] , Nothing )
188188
0 commit comments