-l for check.
This commit is contained in:
@@ -18,7 +18,7 @@ checkSyntax :: Options
|
||||
-> [FilePath] -- ^ The target files.
|
||||
-> IO String
|
||||
checkSyntax _ _ [] = error "ghc-mod: checkSyntax: No files given"
|
||||
checkSyntax opt cradle files = unlines <$> withGHC sessionName (check opt cradle files)
|
||||
checkSyntax opt cradle files = convert opt <$> withGHC sessionName (check opt cradle files)
|
||||
where
|
||||
sessionName = case files of
|
||||
[file] -> file
|
||||
|
||||
@@ -31,6 +31,8 @@ module Language.Haskell.GhcMod.Internal (
|
||||
, runAnyOne
|
||||
-- * 'GhcMonad' Choice
|
||||
, (|||>)
|
||||
-- * Misc
|
||||
, convert
|
||||
) where
|
||||
|
||||
import Language.Haskell.GhcMod.Browse
|
||||
|
||||
@@ -75,7 +75,11 @@ tupToString ((a,b,c,d),s) = show a ++ " "
|
||||
++ quote s
|
||||
|
||||
quote :: String -> String
|
||||
quote x = "\"" ++ x ++ "\""
|
||||
quote x = "\"" ++ escape x ++ "\""
|
||||
where
|
||||
escape [] = []
|
||||
escape ('"':ys) = '\\':'\"':escape ys
|
||||
escape (y:ys) = y:escape ys
|
||||
|
||||
addNewLine :: String -> String
|
||||
addNewLine = (++ "\n")
|
||||
|
||||
Reference in New Issue
Block a user