You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{-# LANGUAGE OverloadedStrings #-}
importIdeSessionimportData.MonoidimportData.Stringfoo_hs, foo_txt1, foo_txt2::IsStringa=>a
foo_hs ="{-# LANGUAGE TemplateHaskell #-}\n\ \import Language.Haskell.TH.Syntax\n\ \main = print $(do\n\ \ let fp = \"foo.txt\"\n\ \ qAddDependentFile fp\n\ \ str <- qRunIO $ readFile fp\n\ \ lift str)"
foo_txt1 ="version1"
foo_txt2 ="version2"
wdir =dowriteFile"foo.hs" foo_hs
writeFile"foo.txt" foo_txt1
return (conf, update, mupdate2)
where
conf = defaultSessionConfig { configLocalWorkingDir =Just"." }
update =mempty
mupdate2 =dowriteFile"foo.txt" foo_txt2
returnmempty
nowdir =return (defaultSessionConfig, update, mupdate2)
where
update = updateSourceFile "foo.hs" foo_hs
<> updateDataFile "foo.txt" foo_txt1
mupdate2 =return$ updateDataFile "foo.txt" foo_txt2
main::IO()
main =doputStrLn"Working directory"
go wdir
putStrLn"===========\nNo working directory"
go nowdir
go mtriple =do
(conf, update, mupdate2) <- mtriple
sess <- initSession defaultSessionInitParams conf
updateSession sess
(updateTargets (TargetsInclude ["foo.hs"]) <>
updateCodeGeneration True<>
update)
print
runIt sess
putStrLn"\n\nUpdating file"
update2 <- mupdate2
updateSession sess update2 print
runIt sess
runIt sess =do
getSourceErrors sess >>=print
ra <- runStmt sess "Main""main"let loop =do
res <- runWait ra
case res ofLeft bs ->print bs >> loop
Right x ->print x
loop
I at first thought this was a problem with the working directory case, but turns out the non-working-directory case also demonstrates the issue. This was working in the past, and I thought there were test cases for it.
Minimal reproducing test case:
I at first thought this was a problem with the working directory case, but turns out the non-working-directory case also demonstrates the issue. This was working in the past, and I thought there were test cases for it.
Originally reported in urbanslug/wai-devel#6
The text was updated successfully, but these errors were encountered: