on master help sign in
Support :apropos in IDESlave
bb3a7b7David Raymond Christiansen
src/Idris/IdeSlave.hs+2
@@ -135,6 +135,7 @@ data IdeSlaveCommand = REPLCompletions String
135 | ProofSearch Int String [String]
135 | ProofSearch Int String [String]
136 | LoadFile String
136 | LoadFile String
137 | DocsFor String
137 | DocsFor String
138+ | Apropos String
138 deriving Show
139 deriving Show
139
140
140sexpToCommand :: SExp -> Maybe IdeSlaveCommand
141sexpToCommand :: SExp -> Maybe IdeSlaveCommand
@@ -153,6 +154,7 @@ sexpToCommand (SexpList [SymbolAtom "proof-search", IntegerAtom line, StringAtom
153 StringAtom s -> Just s
154 StringAtom s -> Just s
154 _ -> Nothing)
155 _ -> Nothing)
155sexpToCommand (SexpList [SymbolAtom "docs-for", StringAtom name]) = Just (DocsFor name)
156sexpToCommand (SexpList [SymbolAtom "docs-for", StringAtom name]) = Just (DocsFor name)
157+sexpToCommand (SexpList [SymbolAtom "apropos", StringAtom search]) = Just (Apropos search)
156sexpToCommand _ = Nothing
158sexpToCommand _ = Nothing
157
159
158parseMessage :: String -> Either Err (SExp, Integer)
160parseMessage :: String -> Either Err (SExp, Integer)
src/Idris/REPL.hs+4
@@ -266,6 +266,8 @@ ideslave orig mods
266 process stdout fn (MakeWith False line (sUN name))
266 process stdout fn (MakeWith False line (sUN name))
267 Just (IdeSlave.ProofSearch line name hints) ->
267 Just (IdeSlave.ProofSearch line name hints) ->
268 process stdout fn (DoProofSearch False line (sUN name) (map sUN hints))
268 process stdout fn (DoProofSearch False line (sUN name) (map sUN hints))
269+ Just (IdeSlave.Apropos a) ->
270+ process stdout fn (Apropos a)
269 Nothing -> do iPrintError "did not understand")
271 Nothing -> do iPrintError "did not understand")
270 (\e -> do iPrintError $ show e))
272 (\e -> do iPrintError $ show e))
271 (\e -> do iPrintError $ show e)
273 (\e -> do iPrintError $ show e)
@@ -337,6 +339,8 @@ ideslaveProcess fn (MakeWith False pos str) = process stdout fn (MakeWith False
337ideslaveProcess fn (DoProofSearch False pos str xs) = process stdout fn (DoProofSearch False pos str xs)
339ideslaveProcess fn (DoProofSearch False pos str xs) = process stdout fn (DoProofSearch False pos str xs)
338ideslaveProcess fn (SetConsoleWidth w) = do process stdout fn (SetConsoleWidth w)
340ideslaveProcess fn (SetConsoleWidth w) = do process stdout fn (SetConsoleWidth w)
339 iPrintResult ""
341 iPrintResult ""
342+ideslaveProcess fn (Apropos a) = do process stdout fn (Apropos a)
343+ iPrintResult ""
340ideslaveProcess fn _ = iPrintError "command not recognized or not supported"
344ideslaveProcess fn _ = iPrintError "command not recognized or not supported"
341
345
342
346