@@ -41,6 +41,8 @@ import Idris.Core.Constraints
4141import IRTS.Compiler
4242import IRTS.CodegenCommon
4343
44+import Data.List.Split (splitOn)
45+
4446import Text.Trifecta.Result(Result(..))
4547
4648-- import RTS.SC
@@ -249,7 +251,14 @@ ideslave orig mods
249251 Just x -> iPrintError $ "didn't load " ++ filename
250252 ideslave orig [filename]
251253 Just (IdeSlave.TypeOf name) ->
252− process stdout "(ideslave)" (Check (PRef (FC "(ideslave)" 0 0) (sUN name)))
254+ case splitName name of
255+ Left err -> iPrintError err
256+ Right n -> process stdout "(ideslave)"
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)
253262 Just (IdeSlave.CaseSplit line name) ->
254263 process stdout fn (CaseSplitAt False line (sUN name))
255264 Just (IdeSlave.AddClause line name) ->
@@ -266,6 +275,11 @@ ideslave orig mods
266275 (\e -> do iPrintError $ show e))
267276 (\e -> do iPrintError $ show e)
268277 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
269283
270284ideslaveProcess :: FilePath -> Command -> Idris ()
271285ideslaveProcess fn Help = process stdout fn Help