mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-15 18:52:13 +03:00
Show module parameters when browsing. See #586
This commit is contained in:
parent
d5be2eab0e
commit
83fb997326
@ -837,7 +837,7 @@ quitCmd = stop
|
||||
|
||||
browseCmd :: String -> REPL ()
|
||||
browseCmd input = do
|
||||
(_, iface, fNames, disp) <- getFocusedEnv
|
||||
(params, iface, fNames, disp) <- getFocusedEnv
|
||||
denv <- getDynEnv
|
||||
let names = M.deNames denv `M.shadowing` fNames
|
||||
|
||||
@ -862,10 +862,23 @@ browseCmd input = do
|
||||
visibleDecl = isUser &&& restricted &&& inSet visibleDecls
|
||||
|
||||
|
||||
browseMParams params disp
|
||||
browseTSyns visibleType iface disp
|
||||
browseNewtypes visibleType iface disp
|
||||
browseVars visibleDecl iface disp
|
||||
|
||||
|
||||
browseMParams :: M.IfaceParams-> NameDisp -> REPL ()
|
||||
browseMParams M.IfaceParams { .. } names =
|
||||
do ppBlock names ppParamTy "Type Parameters" (Map.elems ifParamTypes)
|
||||
ppBlock names ppParamFu "Value Parameters" (Map.elems ifParamFuns)
|
||||
|
||||
where
|
||||
ppParamTy T.ModTParam { .. } = hang (pp mtpName <+> ":") 2 (pp mtpKind)
|
||||
ppParamFu T.ModVParam { .. } = hang (pp mvpName <+> ":") 2 (pp mvpType)
|
||||
|
||||
|
||||
|
||||
browseTSyns :: (M.Name -> Bool) -> M.IfaceDecls -> NameDisp -> REPL ()
|
||||
browseTSyns isVisible M.IfaceDecls { .. } names = do
|
||||
let tsyns = sortBy (M.cmpNameDisplay names `on` T.tsName)
|
||||
|
Loading…
Reference in New Issue
Block a user