GitHub PullRequestEvent at 2014-01-27 20:48:44
Repository: rstudio
Actor: jmcphers
Payload: {"action":"opened","number":88,"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/88","id":11919521,"html_url":"https://github.com/rstudio/rstudio/pull/88","diff_url":"https://github.com/rstudio/rstudio/pull/88.diff","patch_url":"https://github.com/rstudio/rstudio/pull/88.patch","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/88","number":88,"state":"open","title":"Improve top-level debugging experience","user":{"login":"jmcphers","id":470418,"avatar_url":"https://gravatar.com/avatar/0a32ab39e63851edc8a26e04b5196875?d=https%3A%2F%2Fidenticons.github.com%2F68e59f9d02869810acde7f22a046d178.png&r=x","gravatar_id":"0a32ab39e63851edc8a26e04b5196875","url":"https://api.github.com/users/jmcphers","html_url":"https://github.com/jmcphers","followers_url":"https://api.github.com/users/jmcphers/followers","following_url":"https://api.github.com/users/jmcphers/following{/other_user}","gists_url":"https://api.github.com/users/jmcphers/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcphers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcphers/subscriptions","organizations_url":"https://api.github.com/users/jmcphers/orgs","repos_url":"https://api.github.com/users/jmcphers/repos","events_url":"https://api.github.com/users/jmcphers/events{/privacy}","received_events_url":"https://api.github.com/users/jmcphers/received_events","type":"User","site_admin":false},"body":"This change alters the way top-level debugging works. The change has the following user-facing benefits:\r\n\r\n- Stepping at the top level now works exactly like stepping through a function--loop bodies are stepped through one iteration at a time, etc. This was a common request on the support forum and the motivation for the work.\r\n\r\n- The interface for top-level debugging now matches exactly with the interface for function debugging; the console experience is identical (it's a standard R environment browser at which one can use 'n', 'c', etc.)\r\n\r\n- The file being sourced appears on the callstack, so it is possible to see e.g. the line from which an error arises.\r\n\r\n- Breakpoints can now be set *within* top-level sub-expressions, such as loops or anonymous functions. It was previously only possible to set breakpoints on the outermost expressions in the file.\r\n\r\n- Future improvements to the function debugging experience (added by R core or ourselves) will carry over to top-level debugging without additional engineering work.\r\n\r\nPreviously, top-level debugging worked by having the server and the client step through each of the top-level expressions in the file together (breaking up the `parse` and `eval` steps). After each expression was evaluated, the client and server stopped to see whether a breakpoint had been hit or breakpoints needed to be injected. \r\n\r\nThis approach works differently. The core of the work is in `makeSourceEquivalentFunction`, and works roughly as follows:\r\n\r\n1. The file is parsed into an expression tree.\r\n2. The expressions are wrapped into a function that evaluates them in the global environment.\r\n3. Source references are created and copied into the function so that the parsed expressions map seamlessly back into the file being sourced.\r\n3. Breakpoints (top-level and otherwise) are injected into the function. (This uses the server knowledge of breakpoints originally introduced to implement Shiny breakpoints.)\r\n4. The function is executed.\r\n\r\nThis is not a simple operation, but once performed, it significantly reduces the amount of bookkeeping and state that needs to be maintained during top-level debugging; there is a little special treatment of the source-equivalent function, but the debugger is no longer required to have a special \"top-level debugging\" state.\r\n\r\nFinally, this is all done synchronously on the server without client interaction; previously, `debugSource` needed to run at the console and be seen by the IDE to work effectively. This puts into place the architecture we will need to make `debugSource` a drop-in replacement for `source` if we decide to do that work. ","created_at":"2014-01-27T20:48:43Z","updated_at":"2014-01-27T20:48:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/rstudio/pulls/88/commits","review_comments_url":"https://api.github.com/repos/rstudio/rstudio/pulls/88/comments","review_comment_url":"/repos/rstudio/rstudio/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/88/comments","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/a9affb935cd8c613dec5bb0568f9cdd56513423d","head":{"label":"rstudio:feature/toplevel-debugging","ref":"feature/toplevel-debugging","sha":"a9affb935cd8c613dec5bb0568f9cdd56513423d","user":{"login":"rstudio","id":513560,"avatar_url":"https://gravatar.com/avatar/55e0d0e4096ddad3399659f18f2e7000?d=https%3A%2F%2Fidenticons.github.com%2Fbdde82b7f35c4b6049ad726b4683b482.png&r=x","gravatar_id":"55e0d0e4096ddad3399659f18f2e7000","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://gravatar.com/avatar/55e0d0e4096ddad3399659f18f2e7000?d=https%3A%2F%2Fidenticons.github.com%2Fbdde82b7f35c4b6049ad726b4683b482.png&r=x","gravatar_id":"55e0d0e4096ddad3399659f18f2e7000","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments/{number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","created_at":"2010-12-07T19:10:25Z","updated_at":"2014-01-27T20:48:43Z","pushed_at":"2014-01-27T20:16:42Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":296877,"stargazers_count":681,"watchers_count":681,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":105,"mirror_url":null,"open_issues_count":4,"forks":105,"open_issues":4,"watchers":681,"default_branch":"master","master_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"b9da998c2cdcfc8993ebfeffceadaa4e2c86b3fe","user":{"login":"rstudio","id":513560,"avatar_url":"https://gravatar.com/avatar/55e0d0e4096ddad3399659f18f2e7000?d=https%3A%2F%2Fidenticons.github.com%2Fbdde82b7f35c4b6049ad726b4683b482.png&r=x","gravatar_id":"55e0d0e4096ddad3399659f18f2e7000","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://gravatar.com/avatar/55e0d0e4096ddad3399659f18f2e7000?d=https%3A%2F%2Fidenticons.github.com%2Fbdde82b7f35c4b6049ad726b4683b482.png&r=x","gravatar_id":"55e0d0e4096ddad3399659f18f2e7000","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments/{number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","created_at":"2010-12-07T19:10:25Z","updated_at":"2014-01-27T20:48:43Z","pushed_at":"2014-01-27T20:16:42Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":296877,"stargazers_count":681,"watchers_count":681,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":105,"mirror_url":null,"open_issues_count":4,"forks":105,"open_issues":4,"watchers":681,"default_branch":"master","master_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/88"},"html":{"href":"https://github.com/rstudio/rstudio/pull/88"},"issue":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/88"},"comments":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/88/comments"},"commits":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/rstudio/statuses/a9affb935cd8c613dec5bb0568f9cdd56513423d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":21,"additions":543,"deletions":681,"changed_files":26}}