@@ -338,53 +338,27 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
338 pprintPTerm imp (zip ns (repeat False)) [] t
338 pprintPTerm imp (zip ns (repeat False)) [] t
339 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
339 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
340 in ((n', t', spans) : fst rest, snd rest)
340 in ((n', t', spans) : fst rest, snd rest)
341−runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n d) =
341+runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n) =
342 case splitName n of
342 case splitName n of
343 Left err -> iPrintError err
343 Left err -> iPrintError err
344− Right n -> do res <- findCallers d n
344+ Right n -> do calls <- whoCalls n
345− let msg = (IdeSlave.SymbolAtom "ok", res)
346+ let msg = (IdeSlave.SymbolAtom "ok",
347+ map (\ (n,ns) -> (pn ist n, map (pn ist) ns)) calls)
346 runIO . putStrLn $ IdeSlave.convSExp "return" msg id
348 runIO . putStrLn $ IdeSlave.convSExp "return" msg id
347− where findCallers d n | d > 1 = do calls <- whoCalls n
349− out <- mapM (\(n, ns) ->
350− do ns' <- mapM (findCallers (d-1)) ns
351− return (pn ist n, zip (map (pn ist) ns) ns'))
353− return $ IdeSlave.toSExp out
354− | otherwise = do calls <- whoCalls n
356− return . IdeSlave.toSExp $
359− map (\n -> (pn ist n, nil)) ns))
361− nil = IdeSlave.SexpList []
362− pn ist = displaySpans .
349+ where pn ist = displaySpans .
363 renderPretty 0.9 1000 .
350 renderPretty 0.9 1000 .
364 fmap (fancifyAnnots ist) .
351 fmap (fancifyAnnots ist) .
365 prettyName True []
352 prettyName True []
366−runIdeSlaveCommand id orig fn mods (IdeSlave.CallsWho n d) =
353+runIdeSlaveCommand id orig fn mods (IdeSlave.CallsWho n) =
367 case splitName n of
354 case splitName n of
368 Left err -> iPrintError err
355 Left err -> iPrintError err
369− Right n -> do res <- findCallees d n
356+ Right n -> do calls <- callsWho n
370− let msg = (IdeSlave.SymbolAtom "ok", res)
358+ let msg = (IdeSlave.SymbolAtom "ok",
359+ map (\ (n,ns) -> (pn ist n, map (pn ist) ns)) calls)
371 runIO . putStrLn $ IdeSlave.convSExp "return" msg id
360 runIO . putStrLn $ IdeSlave.convSExp "return" msg id
372− where findCallees d n | d > 1 = do calls <- callsWho n
374− out <- mapM (\(n, ns) ->
375− do ns' <- mapM (findCallees (d-1)) ns
376− return (pn ist n, zip (map (pn ist) ns) ns'))
378− return $ IdeSlave.toSExp out
379− | otherwise = do calls <- callsWho n
381− return . IdeSlave.toSExp $
384− map (\n -> (pn ist n, nil)) ns))
386− nil = IdeSlave.SexpList []
387− pn ist = displaySpans .
361+ where pn ist = displaySpans .
388 renderPretty 0.9 1000 .
362 renderPretty 0.9 1000 .
389 fmap (fancifyAnnots ist) .
363 fmap (fancifyAnnots ist) .
390 prettyName True []
364 prettyName True []