Skip to content

Commit feb1551

Browse files
committed
fix(info): correctly indent docexample code block
This modifies the info command to print the docexample code block on a new line and indent each line by 4 spaces to align with the rest of the metadata.
1 parent d0b3472 commit feb1551

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Primitives.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ primitiveInfo _ ctx target@(XObj (Sym path@(SymPath _ name) _) _ _) =
352352
>> maybe (pure ()) (printMetaBool "Private") (Meta.get "private" metaData)
353353
>> maybe (pure ()) (printMetaBool "Hidden") (Meta.get "hidden" metaData)
354354
>> maybe (pure ()) (printMetaVal "Signature" pretty) (Meta.get "sig" metaData)
355-
>> maybe (pure ()) (printMetaVal "Example" (either (const "") id . unwrapStringXObj)) (Meta.get "docexample" metaData)
355+
>> maybe (pure ()) (\xobj -> putStr (" Example:\n" ++ (unlines . map (" " ++) . lines $ either (const "") id (unwrapStringXObj xobj)))) (Meta.get "docexample" metaData)
356356
>> maybe (pure ()) printDeprecated (Meta.get "deprecated" metaData)
357357
>> when (projectPrintTypedAST proj) (putStrLnWithColor Yellow (prettyTyped x))
358358
printMetaBool :: String -> XObj -> IO ()

0 commit comments

Comments
 (0)