Include 'refine' again
This commit is contained in:
parent
57bd408785
commit
c3722f7a20
@ -28,6 +28,7 @@ module Language.Haskell.GhcMod (
|
||||
, types
|
||||
, splits
|
||||
, sig
|
||||
, refine
|
||||
, modules
|
||||
, languages
|
||||
, flags
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
module Language.Haskell.GhcMod.FillSig (
|
||||
sig
|
||||
, refine
|
||||
) where
|
||||
|
||||
import Data.Char (isSymbol)
|
||||
@ -181,13 +182,14 @@ isSymbolName [] = error "This should never happen"
|
||||
-- REWRITE A HOLE / UNDEFINED VIA A FUNCTION
|
||||
----------------------------------------------------------------
|
||||
|
||||
{-
|
||||
refine :: IOish m
|
||||
=> FilePath -- ^ A target file.
|
||||
-> Int -- ^ Line number.
|
||||
-> Int -- ^ Column number.
|
||||
-> Expression -- ^ A Haskell expression.
|
||||
-> GhcModT m String
|
||||
refine file lineNo colNo expr = undefined
|
||||
{-
|
||||
refine file lineNo colNo expr = ghandle handler body
|
||||
where
|
||||
body = inModuleContext file $ \dflag style -> do
|
||||
|
@ -125,7 +125,7 @@ main = flip E.catches handlers $ do
|
||||
"type" -> nArgs 4 $ types cmdArg1 (read cmdArg3) (read cmdArg4)
|
||||
"split" -> nArgs 4 $ splits cmdArg1 (read cmdArg3) (read cmdArg4)
|
||||
"sig" -> nArgs 4 $ sig cmdArg1 (read cmdArg3) (read cmdArg4)
|
||||
--"refine" -> nArgs 5 $ refine cmdArg1 (read cmdArg3) (read cmdArg4) cmdArg5
|
||||
"refine" -> nArgs 5 $ refine cmdArg1 (read cmdArg3) (read cmdArg4) cmdArg5
|
||||
"find" -> nArgs 1 $ findSymbol cmdArg1
|
||||
"lint" -> nArgs 1 $ withFile lint cmdArg1
|
||||
"root" -> rootInfo
|
||||
|
@ -137,7 +137,7 @@ loop set mvar = do
|
||||
"type" -> showType set arg
|
||||
"split" -> doSplit set arg
|
||||
"sig" -> doSig set arg
|
||||
-- "refine" -> doRefine set arg
|
||||
"refine" -> doRefine set arg
|
||||
"boot" -> bootIt set
|
||||
"browse" -> browseIt set arg
|
||||
"quit" -> return ("quit", False, set)
|
||||
@ -270,16 +270,15 @@ doSig set fileArg = do
|
||||
ret <- sig file (read line) (read column)
|
||||
return (ret, True, set')
|
||||
|
||||
{-
|
||||
doRefine :: Set FilePath
|
||||
doRefine :: IOish m
|
||||
=> Set FilePath
|
||||
-> FilePath
|
||||
-> GhcMod (String, Bool, Set FilePath)
|
||||
-> GhcModT m (String, Bool, Set FilePath)
|
||||
doRefine set fileArg = do
|
||||
let [file, line, column, expr] = words fileArg
|
||||
set' <- newFileSet set file
|
||||
ret <- rewrite file (read line) (read column) expr
|
||||
ret <- refine file (read line) (read column) expr
|
||||
return (ret, True, set')
|
||||
-}
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user