@@ -338,53 +338,27 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
338338 pprintPTerm imp (zip ns (repeat False)) [] t
339339 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
340340 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) =
342342 case splitName n of
343343 Left err -> iPrintError err
344− Right n -> do res <- findCallers d n
345− let msg = (IdeSlave.SymbolAtom "ok", res)
344+ Right n -> do calls <- whoCalls n
345+ ist <- getIState
346+ let msg = (IdeSlave.SymbolAtom "ok",
347+ map (\ (n,ns) -> (pn ist n, map (pn ist) ns)) calls)
346348 runIO . putStrLn $ IdeSlave.convSExp "return" msg id
347− where findCallers d n | d > 1 = do calls <- whoCalls n
348− ist <- getIState
349− out <- mapM (\(n, ns) ->
350− do ns' <- mapM (findCallers (d-1)) ns
351− return (pn ist n, zip (map (pn ist) ns) ns'))
352− calls
353− return $ IdeSlave.toSExp out
354− | otherwise = do calls <- whoCalls n
355− ist <- getIState
356− return . IdeSlave.toSExp $
357− map (\(n, ns) ->
358− (pn ist n,
359− map (\n -> (pn ist n, nil)) ns))
360− calls
361− nil = IdeSlave.SexpList []
362− pn ist = displaySpans .
349+ where pn ist = displaySpans .
363350 renderPretty 0.9 1000 .
364351 fmap (fancifyAnnots ist) .
365352 prettyName True []
366−runIdeSlaveCommand id orig fn mods (IdeSlave.CallsWho n d) =
353+runIdeSlaveCommand id orig fn mods (IdeSlave.CallsWho n) =
367354 case splitName n of
368355 Left err -> iPrintError err
369− Right n -> do res <- findCallees d n
370− let msg = (IdeSlave.SymbolAtom "ok", res)
356+ Right n -> do calls <- callsWho n
357+ ist <- getIState
358+ let msg = (IdeSlave.SymbolAtom "ok",
359+ map (\ (n,ns) -> (pn ist n, map (pn ist) ns)) calls)
371360 runIO . putStrLn $ IdeSlave.convSExp "return" msg id
372− where findCallees d n | d > 1 = do calls <- callsWho n
373− ist <- getIState
374− out <- mapM (\(n, ns) ->
375− do ns' <- mapM (findCallees (d-1)) ns
376− return (pn ist n, zip (map (pn ist) ns) ns'))
377− calls
378− return $ IdeSlave.toSExp out
379− | otherwise = do calls <- callsWho n
380− ist <- getIState
381− return . IdeSlave.toSExp $
382− map (\(n, ns) ->
383− (pn ist n,
384− map (\n -> (pn ist n, nil)) ns))
385− calls
386− nil = IdeSlave.SexpList []
387− pn ist = displaySpans .
361+ where pn ist = displaySpans .
388362 renderPretty 0.9 1000 .
389363 fmap (fancifyAnnots ist) .
390364 prettyName True []