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