-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add @autoinfiltrate
for simple, ad-hoc interactive debugging
#150
Conversation
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.
That's nice. I've always opened the GH page and copied that into our code
if isdefined(Main, :Infiltrator)
Main.infiltrate(@__MODULE__, Base.@locals, @__FILE__, @__LINE__)
end
But JuliaFormatter
is failing.
That's exactly why I added this to Trix.jl in the first place 🤣
Sorry. Rectified. |
src/util.jl
Outdated
return Expr( | ||
:macrocall, | ||
Symbol("@warn"), | ||
lnn, | ||
"Could not load Infiltrator.") | ||
return Expr(:macrocall, | ||
Symbol("@warn"), | ||
lnn, | ||
"Could not load Infiltrator.") |
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.
Note that we can allow the previous version in the future with the option variable_call_indent
(see domluna/JuliaFormatter.jl#676).
I want to wait for this PR to make it into VSCode before we add it to TrixiP, though.
Codecov Report
@@ Coverage Diff @@
## main #150 +/- ##
==========================================
- Coverage 50.47% 50.29% -0.19%
==========================================
Files 38 38
Lines 2193 2201 +8
==========================================
Hits 1107 1107
- Misses 1086 1094 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Same as trixi-framework/Trixi.jl#1465
This allows one to have the Infiltrator.jl package installed anywhere in the Julia environment stack and then just add
@autoinfiltrate
to any function in TrixiParticles.jl. When the macro location is hit, it will drop you into an interactive session that allows you to inspect the local variables (see also the Infiltrator.jl docs).I don't know if this is useful for you, but since I added it for Trix.jl, I thought I might add it here as well.