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

Haddock generation: Cabal macros not available #264

Open
snoyberg opened this issue Dec 17, 2014 · 2 comments
Open

Haddock generation: Cabal macros not available #264

snoyberg opened this issue Dec 17, 2014 · 2 comments
Labels

Comments

@snoyberg
Copy link
Member

{-# LANGUAGE OverloadedStrings #-}
import IdeSession
import Data.Monoid

update = updateSourceFile "Main.hs"
    "{-# LANGUAGE CPP #-}\n\
    \#if MIN_VERSION_bytestring(0,10,0)\n\
    \main = return ()\n\
    \#endif" <>
     updateCodeGeneration True

main :: IO ()
main = do
    sess <- initSession defaultSessionInitParams defaultSessionConfig

    updateSession sess update print

    getSourceErrors sess >>= print

    ra <- runStmt sess "Main" "main"
    let loop = do
            eres <- runWait ra
            case eres of
                Left bs -> print bs >> loop
                Right res -> print res
    loop

    updateSession sess buildDoc print

    distdir <- getDistDir sess
    readFile (distdir ++ "/doc/ide-backend-doc.stdout") >>= print
    readFile (distdir ++ "/doc/ide-backend-doc.stderr") >>= print

Output:

$ runghc Main.hs 
[1 of 1] Compiling Main
[]
RunOk
""
"\ndist/build/tmp-28735/src/Main.hs:2:0:\n     error: missing binary operator before token \"(\"\n"
@Mikolaj
Copy link
Collaborator

Mikolaj commented Dec 17, 2014

May be related to #192.

@mgsloan mgsloan added the bug label Jul 22, 2015
@mgsloan
Copy link
Contributor

mgsloan commented Jul 22, 2015

I've verified that this is still a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants