moodymudskipper / flow

View and Browse Code Using Flow Diagrams
https://moodymudskipper.github.io/flow/
Other
395 stars 26 forks source link

flow_debug, one more time #30

Closed moodymudskipper closed 3 years ago

moodymudskipper commented 4 years ago

I think we can start from flow_run's code, and at the end of each step :

Maybe we can debug the actual code by block, will need to play around, I could do it now but I don't want to expose the user to weird internal code.

moodymudskipper commented 3 years ago

this works, flow_run() has a browse = FALSE argument, if TRUE we navigate block by block, and we can do most of what we can do with browser()

One think we don't have is a RStudio button to stop browsing and continue executing, so I think we should implement the shortcut "f" as in browser()

It might be neat also to display the code that we are about to run, for clarity but also to be able to copy and paste, because we can't select text in the viewer

I think it could also be nice to be able to choose at which box to start, which could be done by feeding a number to browse (and TRUE would mean 1 so would work exactly as it does now)

moodymudskipper commented 3 years ago

Actually we don't need to copy brower completely, indeed the shortcuts "f" and "c" are very annoying because ambiguous. Because we use readline here we don't need to be syntactic, which is great because if we're not syntactic we're not ambiguous.

I'm thinking about some keywords like :

c! cont! help! etc

This are the same than the one from browser (and would be slightly adapted to make sense here) with a exclamation mark in the end to disambiguate them.

Next to this we can have other commands such as : goto n! : to go to block n png path! : to print to png etc

We can have some commands allowing us to control the layout as we go (if we want to show a partial diagram for instance).

This will allow a pleasing debugging experience as we can walk through the function and see where we are even with a small viewer window.

pure display args like swap, narrow, and others to be defined, could be modified from the debugger with the help of these commands.

moodymudskipper commented 3 years ago

finally done using the native browser.

We could still have special commands to go to etc, but we can just set browse to multiple locations from the start so value would be limited.

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.