Open gaborcsardi opened 7 years ago
As a first step, we could just include the file name and line number of the source code.
I think file+line information is only available from the parse data? This seems incompatible with the way we instrument now.
If we changed to instrumenting the parse data, we could switch to instrumenting comments (#35), this gives true zero-cost debugging. Would you support that?
If the installed package has source references, then there is file + line information, I think.
Yes, we have parse data. But if we walk the language tree, we don't get the source references for every token, AFAICT. Do we need to change pkgload?
E.g. covr walks the language tree and uses the source refs to for every expression, so I think it is possible to do it.
Might not be worth it, though.
Yeah, covr sees internal srcrefs for calls, and can impute them for control flow constructs -- we have strings. But we could search for these strings in the parse data! Not sure about "
vs., '
, it's worth a try.
Still, instrumenting the parse data and using comments would be much better.
We could add ids to the debug messages somehow, and then jump to their place in the code quickly, either just showing the code on the screen like
tracer
, or jumping there in RStudio.