@@ -148,6 +148,8 @@ import Ide.Plugin.Properties (HasProperty,
148148import Ide.PluginUtils (configForPlugin )
149149import Ide.Types (DynFlagsModifications (dynFlagsModifyGlobal , dynFlagsModifyParser ),
150150 PluginId )
151+ import System.FilePath ((<.>) )
152+ import GHC (ms_mod_name )
151153
152154-- | This is useful for rules to convert rules that can only produce errors or
153155-- a result into the more general IdeResult type that supports producing
@@ -348,7 +350,18 @@ getLocatedImportsRule =
348350 Left diags -> pure (diags, Just (modName, Nothing ))
349351 Right (FileImport path) -> pure ([] , Just (modName, Just path))
350352 Right PackageImport -> pure ([] , Nothing )
351- let moduleImports = catMaybes imports'
353+
354+ -- does this module have an hs-boot file? If so add a direct dependency
355+ let bootPath = toNormalizedFilePath' $ fromNormalizedFilePath file <.> " hs-boot"
356+ boot <- use GetFileExists bootPath
357+ bootArtifact <- if boot == Just True
358+ then do
359+ let modName = ms_mod_name ms
360+ loc <- liftIO $ mkHomeModLocation dflags modName (fromNormalizedFilePath bootPath)
361+ return $ Just (noLoc modName, Just (ArtifactsLocation bootPath (Just loc) True ))
362+ else pure Nothing
363+
364+ let moduleImports = catMaybes $ bootArtifact : imports'
352365 pure (concat diags, Just moduleImports)
353366
354367type RawDepM a = StateT (RawDependencyInformation , IntMap ArtifactsLocation ) Action a
@@ -374,7 +387,7 @@ rawDependencyInformation fs = do
374387
375388 go :: NormalizedFilePath -- ^ Current module being processed
376389 -> Maybe ModSummary -- ^ ModSummary of the module
377- -> StateT ( RawDependencyInformation , IntMap ArtifactsLocation ) Action FilePathId
390+ -> RawDepM FilePathId
378391 go f msum = do
379392 -- First check to see if we have already processed the FilePath
380393 -- If we have, just return its Id but don't update any of the state.
0 commit comments