commit
ac6bcc5dd9
1
Check.hs
1
Check.hs
@ -28,4 +28,3 @@ check opt fileName = withGHC $ checkIt `gcatch` handleErrMsg
|
||||
load LoadAllTargets
|
||||
liftIO readLog
|
||||
options = ["-Wall","-fno-warn-unused-do-bind"] ++ ghcOpts opt
|
||||
++ map ("-i" ++) (checkIncludes opt)
|
||||
|
@ -26,7 +26,7 @@ usage = "ghc-mod version 1.0.0\n"
|
||||
++ "\t ghc-mod list [-l]\n"
|
||||
++ "\t ghc-mod lang [-l]\n"
|
||||
++ "\t ghc-mod browse [-l] [-o] <module> [<module> ...]\n"
|
||||
++ "\t ghc-mod check [-g GHC options] [-i inc] <HaskellFile>\n"
|
||||
++ "\t ghc-mod check [-g GHC opt1 -g GHC opt2 ...] <HaskellFile>\n"
|
||||
++ "\t ghc-mod type <HaskellFile> <module> <expression>\n"
|
||||
++ "\t ghc-mod info <HaskellFile> <module> <expression>\n"
|
||||
++ "\t ghc-mod lint [-h opt] <HaskellFile>\n"
|
||||
@ -40,7 +40,6 @@ defaultOptions = Options {
|
||||
convert = toPlain
|
||||
, hlintOpts = []
|
||||
, ghcOpts = []
|
||||
, checkIncludes = []
|
||||
, operators = False
|
||||
, packageConfs = []
|
||||
, useUserPackageConf = True
|
||||
@ -65,9 +64,6 @@ argspec = [ Option "l" ["tolisp"]
|
||||
, Option "" ["no-user-package-conf"]
|
||||
(NoArg (\opts -> opts{ useUserPackageConf = False }))
|
||||
"do not read the user package database"
|
||||
, Option "i" ["include"]
|
||||
(ReqArg (\i opts -> opts{ checkIncludes = i : checkIncludes opts }) "include")
|
||||
"directory to include in search for modules"
|
||||
]
|
||||
|
||||
parseArgs :: [OptDescr (Options -> Options)] -> [String] -> (Options, [String])
|
||||
|
18
README
18
README
@ -20,5 +20,23 @@ or
|
||||
|
||||
(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))
|
||||
|
||||
|
||||
Changes:
|
||||
|
||||
If you have customized GHC import-path like follows,
|
||||
|
||||
(setq ghc-flymake-check-includes '("dir1" "dir2"))
|
||||
|
||||
You may update your settings as follows.
|
||||
|
||||
(setq ghc-ghc-options '("-idir1" "-idir2"))
|
||||
|
||||
or
|
||||
|
||||
(setq ghc-ghc-options '("-idir1:dir2"))
|
||||
|
||||
Now, you can simply pass GHC options to ghc-mod check command.
|
||||
|
||||
|
||||
For more information, see:
|
||||
http://www.mew.org/~kazu/proj/ghc-mod/
|
||||
|
1
Types.hs
1
Types.hs
@ -14,7 +14,6 @@ data Options = Options {
|
||||
convert :: [String] -> String
|
||||
, hlintOpts :: [String]
|
||||
, ghcOpts :: [String]
|
||||
, checkIncludes :: [String]
|
||||
, operators :: Bool
|
||||
, packageConfs :: [FilePath]
|
||||
, useUserPackageConf :: Bool
|
||||
|
@ -17,13 +17,6 @@
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defcustom ghc-flymake-check-includes nil
|
||||
"list of directories to include when checking file"
|
||||
:type '(repeat string)
|
||||
;; :risky nil
|
||||
:require 'ghc-flymake
|
||||
:group 'ghc-flymake)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defconst ghc-error-buffer-name "*GHC Errors*")
|
||||
@ -54,9 +47,8 @@
|
||||
(if ghc-flymake-command
|
||||
(let ((hopts (ghc-mapconcat (lambda (x) (list "-h" x)) ghc-hlint-options)))
|
||||
`(,@hopts "lint" ,file))
|
||||
(let ((gopts (ghc-mapconcat (lambda (x) (list "-g" x)) ghc-ghc-options))
|
||||
(includes (ghc-mapconcat (lambda (x) (list "-i" x)) ghc-flymake-check-includes)))
|
||||
`(,@gopts "check" ,@includes ,file))))
|
||||
(let ((gopts (ghc-mapconcat (lambda (x) (list "-g" x)) ghc-ghc-options)))
|
||||
`(,@gopts "check" ,file))))
|
||||
|
||||
(defun ghc-flymake-toggle-command ()
|
||||
(interactive)
|
||||
|
Loading…
Reference in New Issue
Block a user