-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Dbg with inspect #6116
Dbg with inspect #6116
Conversation
@@ -996,7 +996,7 @@ fn fix_values_captured_in_closure_expr( | |||
.. | |||
} | |||
| Dbg { | |||
loc_condition, | |||
loc_message: loc_condition, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider doing the local rename here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it to loc_condition
so that I wouldn't need a separate match statement. This enables it to be match with Expect
which still uses the name loc_condition
region: loc_expr.region, | ||
}) | ||
} | ||
LowLevelDbg(_, _) => unreachable!("Only exists after desugaring"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a call to a low-level instead of introducing a new variant in this enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe. I think that would require resolving the other function argument at this point. Currently I have only resolved the actually debug string. I am missing the location (should be file path and line number in the long term). If I can figure out a way to get/pipe that information here, I think it can just be a low level (which I think would be a lot nicer).
Add roc_dbg to some platforms. Also start updating some roc_panic impls.
Co-authored-by: Ayaz <[email protected]> Signed-off-by: Brendan Hansknecht <[email protected]>
f4c21c9
to
1f14aa8
Compare
eefbd30
to
69a38c0
Compare
69a38c0
to
7b53f08
Compare
29ab23a
to
9f1f061
Compare
I have tested this with with my AoC platform, and it works perfectly fine. I hope, you can merge this soon. Currently, the roc platform has to export the symbols Is it possible to remove the requirement? |
They are also used for @folkertdev. any thoughts on this? Can platforms remove Long term I assume we may want to simplify how we generate expects such that the compiler essentially is a special testing platform that expects directly hook into, but maybe that is wrong. Just know that the IPC has been flaky at times and also only works for unix (though maybe the flakiness was only a |
Thanks so much @bhansconnect!!! 🤩 🤩 🤩 I know there's some feedback here, but it doesn't look like any of it is blocking, and with Advent of Code starting tomorrow, I really want to get this in so people can have an improved |
Yeah, filed an issue on the follow up changes that are still needed: #6119 |
This could be submitted now, but there are still a number of nice to have changes left.
At a minimum, all platforms should be updated to includeroc_dbg
before this is submitted.Unless I missed one, all platforms should have
roc_dbg
now.Other changes that would be nice to have as well:
file/path:line_number
. (we could maybe even look at adding a richer context like rustsdbg!
that shows a code snippet.roc_dbg
for llvm and dev backend to use when running tests and/or repl.roc_dbg
for the web repl.roc_dbg
is created during normal builds. We no longer need to limitroc_dbg
to just thedev
command. I think it should be added forbuild
and probably alsorun
commands.Update all uses forroc_panic
in platforms to correctly take a*RocStr
instead of a*char
.