Ghc -> GhcMod: Browse, Check

This commit is contained in:
Daniel Gröber
2014-05-10 15:10:34 +02:00
parent e5c6d3e472
commit f1535efcf2
10 changed files with 109 additions and 70 deletions

View File

@@ -139,13 +139,13 @@ loop opt set mvar = do
let (cmd,arg') = break (== ' ') cmdArg
arg = dropWhile (== ' ') arg'
(ret,ok,set') <- case cmd of
"check" -> toGhcMod $ checkStx opt set arg
"check" -> checkStx opt set arg
"find" -> toGhcMod $ findSym opt set arg mvar
"lint" -> toGhcMod $ lintStx opt set arg
"info" -> toGhcMod $ showInfo opt set arg
"type" -> toGhcMod $ showType opt set arg
"boot" -> bootIt set
"browse" -> toGhcMod $ browseIt opt set arg
"browse" -> browseIt set arg
"quit" -> return ("quit", False, set)
"" -> return ("quit", False, set)
_ -> return ([], True, set)
@@ -162,11 +162,11 @@ loop opt set mvar = do
checkStx :: Options
-> Set FilePath
-> FilePath
-> Ghc (String, Bool, Set FilePath)
checkStx opt set file = do
set' <- newFileSet set file
-> GhcMod (String, Bool, Set FilePath)
checkStx _ set file = do
set' <- toGhcMod $ newFileSet set file
let files = S.toList set'
eret <- check opt files
eret <- check files
case eret of
Right ret -> return (ret, True, set')
Left ret -> return (ret, True, set) -- fxime: set
@@ -261,10 +261,9 @@ bootIt set = do
ret <- boot
return (ret, True, set)
browseIt :: Options
-> Set FilePath
browseIt :: Set FilePath
-> ModuleString
-> Ghc (String, Bool, Set FilePath)
browseIt opt set mdl = do
ret <- browse opt mdl
-> GhcMod (String, Bool, Set FilePath)
browseIt set mdl = do
ret <- browse mdl
return (ret, True, set)