{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/rstudioapi/issues/8","labels_url":"https://api.github.com/repos/rstudio/rstudioapi/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/rstudioapi/issues/8/comments","events_url":"https://api.github.com/repos/rstudio/rstudioapi/issues/8/events","html_url":"https://github.com/rstudio/rstudioapi/pull/8","id":118929617,"number":8,"title":"APIs for interacting with source docs","user":{"login":"kevinushey","id":1976582,"avatar_url":"https://avatars.githubusercontent.com/u/1976582?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinushey","html_url":"https://github.com/kevinushey","followers_url":"https://api.github.com/users/kevinushey/followers","following_url":"https://api.github.com/users/kevinushey/following{/other_user}","gists_url":"https://api.github.com/users/kevinushey/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinushey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinushey/subscriptions","organizations_url":"https://api.github.com/users/kevinushey/orgs","repos_url":"https://api.github.com/users/kevinushey/repos","events_url":"https://api.github.com/users/kevinushey/events{/privacy}","received_events_url":"https://api.github.com/users/kevinushey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-25T21:49:53Z","updated_at":"2015-12-01T20:47:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudioapi/pulls/8","html_url":"https://github.com/rstudio/rstudioapi/pull/8","diff_url":"https://github.com/rstudio/rstudioapi/pull/8.diff","patch_url":"https://github.com/rstudio/rstudioapi/pull/8.patch"},"body":"Companion for https://github.com/rstudio/rstudio/pull/532 -- we shouldn't merge until that one is merged, and we should definitely ensure that these are the interfaces we want."},"comment":{"url":"https://api.github.com/repos/rstudio/rstudioapi/issues/comments/161090702","html_url":"https://github.com/rstudio/rstudioapi/pull/8#issuecomment-161090702","issue_url":"https://api.github.com/repos/rstudio/rstudioapi/issues/8","id":161090702,"user":{"login":"kevinushey","id":1976582,"avatar_url":"https://avatars.githubusercontent.com/u/1976582?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinushey","html_url":"https://github.com/kevinushey","followers_url":"https://api.github.com/users/kevinushey/followers","following_url":"https://api.github.com/users/kevinushey/following{/other_user}","gists_url":"https://api.github.com/users/kevinushey/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinushey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinushey/subscriptions","organizations_url":"https://api.github.com/users/kevinushey/orgs","repos_url":"https://api.github.com/users/kevinushey/repos","events_url":"https://api.github.com/users/kevinushey/events{/privacy}","received_events_url":"https://api.github.com/users/kevinushey/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T20:47:46Z","updated_at":"2015-12-01T20:47:46Z","body":"Here's how the context prints + is structured now:\r\n\r\n![screen shot 2015-12-01 at 12 42 12 pm](https://cloud.githubusercontent.com/assets/1976582/11513613/025e173a-9829-11e5-9ddc-c7ffb2470c62.png)\r\n\r\nInstead of having a separate 'range' + 'contents' object, we now have a single 'selection' list, which is structured as an array of pairs of ranges and text, e.g. if we had two active selections:\r\n\r\n```R\r\nlist(\r\n    list(range = ..., text = ...), ## first (primary) selection\r\n    list(range = ..., text = ...)  ## other selection\r\n)\r\n```\r\n\r\n```R\r\n> str(ctx$selection)\r\nList of 1\r\n $ :List of 2\r\n  ..$ range:List of 2\r\n  .. ..$ start:Class 'document_position'  Named num [1:2] 19 4\r\n  .. .. .. ..- attr(*, \"names\")= chr [1:2] \"row\" \"column\"\r\n  .. ..$ end  :Class 'document_position'  Named num [1:2] 19 48\r\n  .. .. .. ..- attr(*, \"names\")= chr [1:2] \"row\" \"column\"\r\n  .. ..- attr(*, \"class\")= chr \"document_range\"\r\n  ..$ text : chr \"invisible(.rs.api.replaceRanges(ranges, to))\"\r\n - attr(*, \"class\")= chr \"document_selection\"\r\n```\r\n\r\n"}}