-
-
Notifications
You must be signed in to change notification settings - Fork 31
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 line number context to stack traces when srcrefs are available #133
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpkyle
added
parity
Modifications to improve parity across Dash implementations
dash-stage-in_review
dash-type-enhancement
labels
Oct 16, 2019
rpkyle
changed the title
132 add line numbers
Add line number context to stack traces when srcrefs are available
Oct 16, 2019
alexcjohnson
approved these changes
Oct 17, 2019
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.
Looks fantastic, this will be really useful! 💃 after one small comment.
rpkyle
added a commit
that referenced
this pull request
Nov 1, 2019
* Add line number context to stack traces when srcrefs are available (#133) * ✨ Support line #s when in debug mode * ✨ Add use_viewer option for RStudio * 🚨 Add soft and hard hot reloading tests
Merged
rpkyle
added a commit
that referenced
this pull request
Jan 4, 2020
* Provide support for no_update in Dash for R (#111) * Use dev_tools_prune_errors instead of pruned_errors (#113) * Better handling for user-defined error conditions in debug mode (#116) * Provide support for multiple outputs (#119) * Provide support for hot reloading in Dash for R (#127) * Implement support for clientside callbacks in Dash for R (#130) * Add line number context to stack traces when srcrefs are available (#133) * Update dash-renderer to 1.2.2 and fix dev tools UI display of stack traces (#137) * Support for meta tags in Dash for R (#142) * Fixes for hot reloading interval handling and refreshing apps within viewer pane (#148) * Support for asynchronous loading/compression in Dash for R (#157) * Support returning asset URLs via public method within Dash class (#160) * Minor fix for get_asset_url + docs, add url_base_pathname (#161)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR proposes to inspect
srcref
attributes, when available, for additional context whendebug=TRUE
and errors are reported in the console or the dev tools UI in-browser. This information is populated in several settings:KeepSource
istrue
in the packageDESCRIPTION
filesource()
andkeep.source = TRUE
(the default in most cases)Rscript
is used to invokesource
at the CLI, andkeep.source = TRUE
is explicitly provided as an argument tosource
(sincekeep.source
does not default toTRUE
in most cases)Some function calls will not have
srcref
attributes populated, and for these no line number is currently displayed. We will continue to investigate whether this functionality can be provided.The initially proposed implementation looks like this:
... and within the dev tools UI, it looks like this:
Since there are enclosing environments between the error handler within
getStackTrace
and theprivate
field to whichstack_message
is passed, it is necessary to resolve the number of frames to ascend up the stack. The proposedcountEnclosingFrames
function is an initial attempt at introducing this functionality.This PR also resolves an issue with the option to display apps within RStudio's viewer pane, and renames that option from
viewer
touse_viewer
.Closes #132. @chriddyp