DanielG / ghc-mod

Happy Haskell Hacking for editors. DEPRECATED
Other
677 stars 175 forks source link

ghc-mod takes a very long time checking a module with a module annotation #936

Open expipiplus1 opened 6 years ago

expipiplus1 commented 6 years ago

It's not too bad on the below testcase, but in a larger file (90 lines) ghc-mod takes longer than my patience to terminate.

$ ghc-mod --version
ghc-mod version 5.9.0.0 compiled by GHC 8.2.2

ghc-mod revision: f638c0f925459f13cc94644109fb971aaf297947

Testcase

ok.hs

main :: IO ()
main = pure ()

bad.hs

{-# ANN module "" #-}
main :: IO ()
main = pure ()
$ time ghc-mod check ok.hs --verbose 7
info: Found no other project type, falling back to plain GHC project
VOMIT: Using the following mapped files:
VOMIT: Initializing GHC session with following options: "-i/home/j/bugs" "-i/home/j/bugs" "-global-package-db" "-user-package-db" "-Wall" "-O0" "-fno-warn-missing-home-modules"
DEBUG: initSession: Session not initialized, creating new one
VOMIT: Using the following targets: "/home/j/bugs/ok.hs"
DEBUG: loadTargets: Loading: ok.hs
DEBUG: loadTargets: filterModSums: False
DEBUG: loadTargets: Loading done
 check ok.hs --verbose 7  0.09s user 0.01s system 100% cpu 0.106 total
$ time ghc-mod check bad.hs --verbose 7
info: Found no other project type, falling back to plain GHC project
VOMIT: Using the following mapped files:
VOMIT: Initializing GHC session with following options: "-i/home/j/bugs" "-i/home/j/bugs" "-global-package-db" "-user-package-db" "-Wall" "-O0" "-fno-warn-missing-home-modules"
DEBUG: initSession: Session not initialized, creating new one
VOMIT: Using the following targets: "/home/j/bugs/bad.hs"
DEBUG: loadTargets: Loading: bad.hs
DEBUG: loadTargets: filterModSums: False
 check bad.hs --verbose 7  3.68s user 0.04s system 99% cpu 3.722 total
DanielG commented 6 years ago

Can you link me to some documentation for this annotation, I'm not familiar with it at all.

expipiplus1 commented 6 years ago

Sure:

https://ghc.haskell.org/trac/ghc/wiki/Annotations https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#source-annotations

On Fri, 1 Jun 2018, 05:56 Daniel Gröber, notifications@github.com wrote:

Can you link me to some documentation for this annotation, I'm not familiar with it at all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DanielG/ghc-mod/issues/936#issuecomment-393693659, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0U3Lj5HmmyQiA9-w7voNpinro_KSzEks5t4GcFgaJpZM4T8vtu .