You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Drup/zarith-ppx#1 (comment) came up the point that mdx doesn't pretty print error locations like the OCaml toplevel does.
As a very random example, here it uses carets to point to the location span:
# let x = 1.2z;;
Line 1, characters 8-12:
1 | let x = 1.2z;;
^^^^
Error: Unknown modifier 'z' for literal 1.2z
(this is with TERM=dumb though; by default underlining is used, but that won't work in Markdown code blocks).
Currently mdx doesn't quote nor pretty print the location, producing output like:
# let x = 1.2z;;
Line 1, characters 8-12:
Error: Unknown modifier 'z' for literal 1.2z
Quoting duplicates the (single-line) input, which might be too verbose, so such behavior might have to be optional.
The text was updated successfully, but these errors were encountered:
It's definitely a nice feature. The only thing that might be problematic (I haven't tested it yet) is that different OCaml compilers display this differently, which MDX would need to unify, since nobody likes their tests to fail because the ^^^^ are now in a slightly different spot.
I feel like this should be reasonably easy to add if we get the location information from the compiler.
In Drup/zarith-ppx#1 (comment) came up the point that mdx doesn't pretty print error locations like the OCaml toplevel does.
As a very random example, here it uses carets to point to the location span:
(this is with
TERM=dumb
though; by default underlining is used, but that won't work in Markdown code blocks).Currently mdx doesn't quote nor pretty print the location, producing output like:
Quoting duplicates the (single-line) input, which might be too verbose, so such behavior might have to be optional.
The text was updated successfully, but these errors were encountered: