-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative message reporting modes #10863
Conversation
a0a6736
to
04ba5c9
Compare
395d102
to
cf200b1
Compare
I like this. Small nitpick: I think this feature is about pretty-printing errors, not about verbose errors. From the latter I would expect more error information, which is not the case here, it is the same information presented in a more readable way. So maybe the define could be |
Good point. Maybe it could become both to some extent but I'm not sure it's something we want there nor if it would be practical.. |
By the way, this might be out of scope here, but: I find the "hint" which says |
Yeah, trying to do something about it; should be possible if I find a nice way to handle Stack errors. There are similar cases where I want to make some improvements too, like https://github.com/HaxeFoundation/haxe/blob/development/src/typing/typeloadCheck.ml#L503 which is just repeating the function name it's pointing to (redundant with pretty errors) |
66f28c7
to
aab8c8e
Compare
Also add logging capabilities with -D messages-log-file=[path]
@Simn if you happen to be bored, I think this PR is ready for review |
I like the I kinda wish we didn't do this stupid tuple stuff so much because it's so awkward to extend. It feels like half of the changes are additional The diff here would also benefit quite a bit from a separate "whitespace cleanup" PR, but it's fine if you can't be arsed to factor that out. |
(needed std path being exposed to misc tests)
Adds alternative message reporting modes with
-D message-reporting=[mode]
Reporting mode: "classic"
Current output, still default reporting mode
Reporting mode: "pretty"
Adds more contextual information to errors (sources) for example like that:
Additionally,
-D no-color
can be used if your terminal doesn't support ANSI escape codes:(from actual test output for 6065)
Reporting mode: "indent"
New mode that uses nesting level data in messages to provide more context to tools exploiting compiler output (vscode tasks, for example). This format is experimental and subject to many changes until the whole feature is done on both sides.
Example:
Additional logging to file
Also adds
-D messages-log-file=[path]
(and-D messages-log-format=[format]
, default being "indent") to make compiler output to a file in addition to terminal output, so that for example you can get user-readable output in terminal and computer-readable output in the log file (to be consumed by tools).Next steps after merge
Called from here (x10)
Review
I guess
Files changed 110
/+1,085 -317
won't exactly help getting review 😅Main changes:
server.ml
holds the actual message reporting modes code0
which is top level)depth
string * pos
at most places instead ofstring
with separatepos
. This was mostly necessary for stacksGrab nightlies to try it out:
58ee66d
nightlies