@@ -41,6 +41,8 @@ import Idris.Core.Constraints
41import IRTS.Compiler
41import IRTS.Compiler
42import IRTS.CodegenCommon
42import IRTS.CodegenCommon
44+import Data.List.Split (splitOn)
44import Text.Trifecta.Result(Result(..))
46import Text.Trifecta.Result(Result(..))
46-- import RTS.SC
48-- import RTS.SC
@@ -249,7 +251,14 @@ ideslave orig mods
249 Just x -> iPrintError $ "didn't load " ++ filename
251 Just x -> iPrintError $ "didn't load " ++ filename
250 ideslave orig [filename]
252 ideslave orig [filename]
251 Just (IdeSlave.TypeOf name) ->
253 Just (IdeSlave.TypeOf name) ->
254+ case splitName name of
255+ Left err -> iPrintError err
256+ Right n -> process stdout "(ideslave)"
252− process stdout "(ideslave)" (Check (PRef (FC "(ideslave)" 0 0) (sUN name)))
257+ (Check (PRef (FC "(ideslave)" 0 0) n))
258+ Just (IdeSlave.DocsFor name) ->
259+ case splitName name of
260+ Left err -> iPrintError err
261+ Right n -> process stdout "(ideslave)" (DocStr n)
253 Just (IdeSlave.CaseSplit line name) ->
262 Just (IdeSlave.CaseSplit line name) ->
254 process stdout fn (CaseSplitAt False line (sUN name))
263 process stdout fn (CaseSplitAt False line (sUN name))
255 Just (IdeSlave.AddClause line name) ->
264 Just (IdeSlave.AddClause line name) ->
@@ -266,6 +275,11 @@ ideslave orig mods
266 (\e -> do iPrintError $ show e))
275 (\e -> do iPrintError $ show e))
267 (\e -> do iPrintError $ show e)
276 (\e -> do iPrintError $ show e)
268 ideslave orig mods
277 ideslave orig mods
278+ where splitName :: String -> Either String Name
279+ splitName s = case reverse $ splitOn "." s of
280+ [] -> Left ("Didn't understand name '" ++ s ++ "'")
281+ [n] -> Right $ sUN n
282+ (n:ns) -> Right $ sNS (sUN n) ns
270ideslaveProcess :: FilePath -> Command -> Idris ()
284ideslaveProcess :: FilePath -> Command -> Idris ()
271ideslaveProcess fn Help = process stdout fn Help
285ideslaveProcess fn Help = process stdout fn Help