Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print info message when ignoring a file due to a none cradle #2701

Merged
merged 2 commits into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ghcide/session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
cradleToOptsAndLibDir :: Show a => Logger -> Cradle a -> FilePath
-> IO (Either [CradleError] (ComponentOptions, FilePath))
cradleToOptsAndLibDir logger cradle file = do
let noneCradleFoundMessage :: FilePath -> T.Text
noneCradleFoundMessage f = T.pack $ "none cradle found for " <> f <> ", ignoring the file"
-- Start off by getting the session options
logDebug logger $ T.pack $ "Output from setting up the cradle " <> show cradle
cradleRes <- HieBios.getCompilerOptions file cradle
Expand All @@ -617,13 +619,14 @@ cradleToOptsAndLibDir logger cradle file = do
-- This is the successful path
CradleSuccess libDir -> pure (Right (r, libDir))
CradleFail err -> return (Left [err])
-- For the None cradle perhaps we still want to report an Info
-- message about the fact that the file is being ignored.
CradleNone -> return (Left [])
CradleNone -> do
logInfo logger $ noneCradleFoundMessage file
return (Left [])

CradleFail err -> return (Left [err])
-- Same here
CradleNone -> return (Left [])
CradleNone -> do
logInfo logger $ noneCradleFoundMessage file
return (Left [])

emptyHscEnv :: IORef NameCache -> FilePath -> IO HscEnv
emptyHscEnv nc libDir = do
Expand Down