Add some more debug output
This commit is contained in:
parent
996016ac7b
commit
86c157d1d2
@ -15,6 +15,7 @@ import Language.Haskell.GhcMod.Internal
|
||||
import Language.Haskell.GhcMod.Target
|
||||
import Language.Haskell.GhcMod.Pretty
|
||||
import Language.Haskell.GhcMod.Utils
|
||||
import Language.Haskell.GhcMod.PathsAndFiles
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
@ -27,7 +28,7 @@ debugInfo = do
|
||||
cabal <-
|
||||
case cradleProjectType of
|
||||
CabalProject -> cabalDebug
|
||||
StackProject -> cabalDebug
|
||||
StackProject -> (++) <$> stackPaths <*> cabalDebug
|
||||
_ -> return []
|
||||
|
||||
pkgOpts <- packageGhcOptions
|
||||
@ -42,6 +43,16 @@ debugInfo = do
|
||||
fsep $ map text optGhcUserOptions)
|
||||
] ++ cabal
|
||||
|
||||
stackPaths :: IOish m => GhcModT m [String]
|
||||
stackPaths = do
|
||||
Cradle {..} <- cradle
|
||||
Just ghc <- getStackGhcPath cradleRootDir
|
||||
Just ghcPkg <- getStackGhcPkgPath cradleRootDir
|
||||
return $
|
||||
[ "Stack ghc executable: " ++ show ghc
|
||||
, "Stack ghc-pkg executable:" ++ show ghcPkg
|
||||
]
|
||||
|
||||
cabalDebug :: IOish m => GhcModT m [String]
|
||||
cabalDebug = do
|
||||
Cradle {..} <- cradle
|
||||
|
@ -288,6 +288,7 @@ resolveGmComponent :: (IOish m, Gm m)
|
||||
-> m (GmComponent 'GMCResolved (Set ModulePath))
|
||||
resolveGmComponent mums c@GmComponent {..} = do
|
||||
distDir <- cradleDistDir <$> cradle
|
||||
gmLog GmDebug "resolveGmComponent" $ text $ show $ ghcOpts distDir
|
||||
withLightHscEnv (ghcOpts distDir) $ \env -> do
|
||||
let srcDirs = if null gmcSourceDirs then [""] else gmcSourceDirs
|
||||
let mg = gmcHomeModuleGraph
|
||||
@ -313,6 +314,7 @@ resolveEntrypoint :: (IOish m, Gm m)
|
||||
-> GmComponent 'GMCRaw ChEntrypoint
|
||||
-> m (GmComponent 'GMCRaw (Set ModulePath))
|
||||
resolveEntrypoint Cradle {..} c@GmComponent {..} = do
|
||||
gmLog GmDebug "resolveEntrypoint" $ text $ show $ gmcGhcSrcOpts
|
||||
withLightHscEnv gmcGhcSrcOpts $ \env -> do
|
||||
let srcDirs = if null gmcSourceDirs then [""] else gmcSourceDirs
|
||||
eps <- liftIO $ resolveChEntrypoints cradleRootDir gmcEntrypoints
|
||||
|
Loading…
Reference in New Issue
Block a user