Skip to content
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

Support going to the code #13

Open
gaborcsardi opened this issue Dec 8, 2016 · 6 comments
Open

Support going to the code #13

gaborcsardi opened this issue Dec 8, 2016 · 6 comments
Assignees
Labels
feature a feature request or enhancement idea
Milestone

Comments

@gaborcsardi
Copy link
Member

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.

@gaborcsardi
Copy link
Member Author

As a first step, we could just include the file name and line number of the source code.

@gaborcsardi gaborcsardi added this to the V2 milestone Apr 23, 2018
@krlmlr krlmlr self-assigned this Jul 11, 2019
@krlmlr
Copy link
Member

krlmlr commented Feb 17, 2021

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?

@gaborcsardi
Copy link
Member Author

If the installed package has source references, then there is file + line information, I think.

@krlmlr
Copy link
Member

krlmlr commented Feb 17, 2021

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?

@gaborcsardi
Copy link
Member Author

gaborcsardi commented Feb 17, 2021

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.

@krlmlr
Copy link
Member

krlmlr commented Feb 17, 2021

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.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement idea
Projects
None yet
Development

No branches or pull requests

2 participants