on master help sign in
Merge pull request #1851 from david-christiansen/ide-names-fix
b068758David Christiansen
src/Idris/REPL.hs+5−12
@@ -331,11 +331,6 @@ runIdeSlaveCommand h id orig fn mods (IdeSlave.TypeOf name) =
331 Left err -> iPrintError err
331 Left err -> iPrintError err
332 Right n -> process "(ideslave)"
332 Right n -> process "(ideslave)"
333 (Check (PRef (FC "(ideslave)" (0,0) (0,0)) n))
333 (Check (PRef (FC "(ideslave)" (0,0) (0,0)) n))
334− where splitName :: String -> Either String Name
335− splitName s = case reverse $ splitOn "." s of
336− [] -> Left ("Didn't understand name '" ++ s ++ "'")
337− [n] -> Right $ sUN n
338− (n:ns) -> Right $ sNS (sUN n) ns
339runIdeSlaveCommand h id orig fn mods (IdeSlave.DocsFor name) =
334runIdeSlaveCommand h id orig fn mods (IdeSlave.DocsFor name) =
340 case parseConst orig name of
335 case parseConst orig name of
341 Success c -> process "(ideslave)" (DocStr (Right c))
336 Success c -> process "(ideslave)" (DocStr (Right c))
@@ -487,11 +482,6 @@ runIdeSlaveCommand h id orig fn mods (IdeSlave.PrintDef name) =
487 case splitName name of
482 case splitName name of
488 Left err -> iPrintError err
483 Left err -> iPrintError err
489 Right n -> process "(ideslave)" (PrintDef n)
484 Right n -> process "(ideslave)" (PrintDef n)
490− where splitName :: String -> Either String Name
491− splitName s = case reverse $ splitOn "." s of
492− [] -> Left ("Didn't understand name '" ++ s ++ "'")
493− [n] -> Right $ sUN n
494− (n:ns) -> Right $ sNS (sUN n) ns
495runIdeSlaveCommand h id orig fn modes (IdeSlave.ErrString e) =
485runIdeSlaveCommand h id orig fn modes (IdeSlave.ErrString e) =
496 do ist <- getIState
486 do ist <- getIState
497 let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
487 let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
@@ -523,8 +513,11 @@ ideSlaveForceTermImplicits h id bnd impl tm =
523splitName :: String -> Either String Name
513splitName :: String -> Either String Name
524splitName s = case reverse $ splitOn "." s of
514splitName s = case reverse $ splitOn "." s of
525 [] -> Left ("Didn't understand name '" ++ s ++ "'")
515 [] -> Left ("Didn't understand name '" ++ s ++ "'")
526− [n] -> Right $ sUN n
516+ [n] -> Right . sUN $ unparen n
527− (n:ns) -> Right $ sNS (sUN n) ns
517+ (n:ns) -> Right $ sNS (sUN (unparen n)) ns
518+ where unparen "" = ""
519+ unparen ('(':x:xs) | last xs == ')' = init (x:xs)
520+ unparen str = str
528
521
529ideslaveProcess :: FilePath -> Command -> Idris ()
522ideslaveProcess :: FilePath -> Command -> Idris ()
530ideslaveProcess fn Warranty = process fn Warranty
523ideslaveProcess fn Warranty = process fn Warranty