GitHub PullRequestReviewCommentEvent at 2014-10-07 09:35:09
Repository: scala-ide
Actor: dragos
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/18508846","id":18508846,"diff_hunk":"@@ -57,6 +57,25 @@ object RegionUtils {\n       val offset = region.getOffset()\n       new RangePosition(sourceFile, offset, offset, offset + region.getLength())\n     }\n+\n+    /** Return a new Region with `f` applied to both start and end offsets.\n+     *\n+     *  Equivalent to `new Region(f(start), f(end))`, but won't return negative\n+     *  lengths. If `f(end)` returns an offset less than `start`, it will round it\n+     *  up at `start`.\n+     */\n+    def map(f: Int => Int): IRegion = {\n+      val newOffset = f(region.getOffset)\n+      val newLen = f(region.getOffset + region.getLength) - newOffset\n+      new Region(newOffset, Math.max(0, newLen))","path":"org.scala-ide.sdt.core/src/org/scalaide/util/eclipse/RegionUtils.scala","position":14,"original_position":14,"commit_id":"51db405b89355d6e050c019825dae4dbb4eb84f3","original_commit_id":"51db405b89355d6e050c019825dae4dbb4eb84f3","user":{"login":"dragos","id":133742,"avatar_url":"https://avatars.githubusercontent.com/u/133742?v=2","gravatar_id":"","url":"https://api.github.com/users/dragos","html_url":"https://github.com/dragos","followers_url":"https://api.github.com/users/dragos/followers","following_url":"https://api.github.com/users/dragos/following{/other_user}","gists_url":"https://api.github.com/users/dragos/gists{/gist_id}","starred_url":"https://api.github.com/users/dragos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragos/subscriptions","organizations_url":"https://api.github.com/users/dragos/orgs","repos_url":"https://api.github.com/users/dragos/repos","events_url":"https://api.github.com/users/dragos/events{/privacy}","received_events_url":"https://api.github.com/users/dragos/received_events","type":"User","site_admin":false},"body":"Ok, I can clarify the comment. A region is an offset and a length (which could be negative). Does it make sense to have this rounding behavior? I tend to agree with @skyluc that it's the practical approach, but makes the specification more complicated by adding an exception.","created_at":"2014-10-07T09:35:09Z","updated_at":"2014-10-07T09:35:09Z","html_url":"https://github.com/scala-ide/scala-ide/pull/820#discussion_r18508846","pull_request_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820","_links":{"self":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/18508846"},"html":{"href":"https://github.com/scala-ide/scala-ide/pull/820#discussion_r18508846"},"pull_request":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820"}}},"pull_request":{"url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820","id":22272056,"html_url":"https://github.com/scala-ide/scala-ide/pull/820","diff_url":"https://github.com/scala-ide/scala-ide/pull/820.diff","patch_url":"https://github.com/scala-ide/scala-ide/pull/820.patch","issue_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/820","number":820,"state":"open","locked":false,"title":"Cleanup hyperlink code and APIify","user":{"login":"dragos","id":133742,"avatar_url":"https://avatars.githubusercontent.com/u/133742?v=2","gravatar_id":"","url":"https://api.github.com/users/dragos","html_url":"https://github.com/dragos","followers_url":"https://api.github.com/users/dragos/followers","following_url":"https://api.github.com/users/dragos/following{/other_user}","gists_url":"https://api.github.com/users/dragos/gists{/gist_id}","starred_url":"https://api.github.com/users/dragos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragos/subscriptions","organizations_url":"https://api.github.com/users/dragos/orgs","repos_url":"https://api.github.com/users/dragos/repos","events_url":"https://api.github.com/users/dragos/events{/privacy}","received_events_url":"https://api.github.com/users/dragos/received_events","type":"User","site_admin":false},"body":"More work could be done to simplify the `detector` strategy pattern, but that's now confined to the internal classes, so can be simplified any time.","created_at":"2014-10-06T09:16:16Z","updated_at":"2014-10-07T09:35:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d21f88c182beceeeff7309549b4b5d1ab509cab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820/commits","review_comments_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820/comments","review_comment_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/{number}","comments_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/820/comments","statuses_url":"https://api.github.com/repos/scala-ide/scala-ide/statuses/51db405b89355d6e050c019825dae4dbb4eb84f3","head":{"label":"dragos:api/hyperlink","ref":"api/hyperlink","sha":"51db405b89355d6e050c019825dae4dbb4eb84f3","user":{"login":"dragos","id":133742,"avatar_url":"https://avatars.githubusercontent.com/u/133742?v=2","gravatar_id":"","url":"https://api.github.com/users/dragos","html_url":"https://github.com/dragos","followers_url":"https://api.github.com/users/dragos/followers","following_url":"https://api.github.com/users/dragos/following{/other_user}","gists_url":"https://api.github.com/users/dragos/gists{/gist_id}","starred_url":"https://api.github.com/users/dragos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragos/subscriptions","organizations_url":"https://api.github.com/users/dragos/orgs","repos_url":"https://api.github.com/users/dragos/repos","events_url":"https://api.github.com/users/dragos/events{/privacy}","received_events_url":"https://api.github.com/users/dragos/received_events","type":"User","site_admin":false},"repo":{"id":3658878,"name":"scala-ide","full_name":"dragos/scala-ide","owner":{"login":"dragos","id":133742,"avatar_url":"https://avatars.githubusercontent.com/u/133742?v=2","gravatar_id":"","url":"https://api.github.com/users/dragos","html_url":"https://github.com/dragos","followers_url":"https://api.github.com/users/dragos/followers","following_url":"https://api.github.com/users/dragos/following{/other_user}","gists_url":"https://api.github.com/users/dragos/gists{/gist_id}","starred_url":"https://api.github.com/users/dragos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragos/subscriptions","organizations_url":"https://api.github.com/users/dragos/orgs","repos_url":"https://api.github.com/users/dragos/repos","events_url":"https://api.github.com/users/dragos/events{/privacy}","received_events_url":"https://api.github.com/users/dragos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dragos/scala-ide","description":"Scala IDE for Eclipse","fork":true,"url":"https://api.github.com/repos/dragos/scala-ide","forks_url":"https://api.github.com/repos/dragos/scala-ide/forks","keys_url":"https://api.github.com/repos/dragos/scala-ide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dragos/scala-ide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dragos/scala-ide/teams","hooks_url":"https://api.github.com/repos/dragos/scala-ide/hooks","issue_events_url":"https://api.github.com/repos/dragos/scala-ide/issues/events{/number}","events_url":"https://api.github.com/repos/dragos/scala-ide/events","assignees_url":"https://api.github.com/repos/dragos/scala-ide/assignees{/user}","branches_url":"https://api.github.com/repos/dragos/scala-ide/branches{/branch}","tags_url":"https://api.github.com/repos/dragos/scala-ide/tags","blobs_url":"https://api.github.com/repos/dragos/scala-ide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dragos/scala-ide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dragos/scala-ide/git/refs{/sha}","trees_url":"https://api.github.com/repos/dragos/scala-ide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dragos/scala-ide/statuses/{sha}","languages_url":"https://api.github.com/repos/dragos/scala-ide/languages","stargazers_url":"https://api.github.com/repos/dragos/scala-ide/stargazers","contributors_url":"https://api.github.com/repos/dragos/scala-ide/contributors","subscribers_url":"https://api.github.com/repos/dragos/scala-ide/subscribers","subscription_url":"https://api.github.com/repos/dragos/scala-ide/subscription","commits_url":"https://api.github.com/repos/dragos/scala-ide/commits{/sha}","git_commits_url":"https://api.github.com/repos/dragos/scala-ide/git/commits{/sha}","comments_url":"https://api.github.com/repos/dragos/scala-ide/comments{/number}","issue_comment_url":"https://api.github.com/repos/dragos/scala-ide/issues/comments/{number}","contents_url":"https://api.github.com/repos/dragos/scala-ide/contents/{+path}","compare_url":"https://api.github.com/repos/dragos/scala-ide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dragos/scala-ide/merges","archive_url":"https://api.github.com/repos/dragos/scala-ide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dragos/scala-ide/downloads","issues_url":"https://api.github.com/repos/dragos/scala-ide/issues{/number}","pulls_url":"https://api.github.com/repos/dragos/scala-ide/pulls{/number}","milestones_url":"https://api.github.com/repos/dragos/scala-ide/milestones{/number}","notifications_url":"https://api.github.com/repos/dragos/scala-ide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dragos/scala-ide/labels{/name}","releases_url":"https://api.github.com/repos/dragos/scala-ide/releases{/id}","created_at":"2012-03-08T10:19:34Z","updated_at":"2014-07-18T09:46:12Z","pushed_at":"2014-10-07T09:33:25Z","git_url":"git://github.com/dragos/scala-ide.git","ssh_url":"git@github.com:dragos/scala-ide.git","clone_url":"https://github.com/dragos/scala-ide.git","svn_url":"https://github.com/dragos/scala-ide","homepage":"www.scala-ide.org","size":144742,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"scala-ide:master","ref":"master","sha":"cb095e42c63d488aaf779b96169f6ad320e473f8","user":{"login":"scala-ide","id":1026788,"avatar_url":"https://avatars.githubusercontent.com/u/1026788?v=2","gravatar_id":"","url":"https://api.github.com/users/scala-ide","html_url":"https://github.com/scala-ide","followers_url":"https://api.github.com/users/scala-ide/followers","following_url":"https://api.github.com/users/scala-ide/following{/other_user}","gists_url":"https://api.github.com/users/scala-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-ide/subscriptions","organizations_url":"https://api.github.com/users/scala-ide/orgs","repos_url":"https://api.github.com/users/scala-ide/repos","events_url":"https://api.github.com/users/scala-ide/events{/privacy}","received_events_url":"https://api.github.com/users/scala-ide/received_events","type":"Organization","site_admin":false},"repo":{"id":2510011,"name":"scala-ide","full_name":"scala-ide/scala-ide","owner":{"login":"scala-ide","id":1026788,"avatar_url":"https://avatars.githubusercontent.com/u/1026788?v=2","gravatar_id":"","url":"https://api.github.com/users/scala-ide","html_url":"https://github.com/scala-ide","followers_url":"https://api.github.com/users/scala-ide/followers","following_url":"https://api.github.com/users/scala-ide/following{/other_user}","gists_url":"https://api.github.com/users/scala-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-ide/subscriptions","organizations_url":"https://api.github.com/users/scala-ide/orgs","repos_url":"https://api.github.com/users/scala-ide/repos","events_url":"https://api.github.com/users/scala-ide/events{/privacy}","received_events_url":"https://api.github.com/users/scala-ide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-ide/scala-ide","description":"Scala IDE for Eclipse","fork":false,"url":"https://api.github.com/repos/scala-ide/scala-ide","forks_url":"https://api.github.com/repos/scala-ide/scala-ide/forks","keys_url":"https://api.github.com/repos/scala-ide/scala-ide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-ide/scala-ide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-ide/scala-ide/teams","hooks_url":"https://api.github.com/repos/scala-ide/scala-ide/hooks","issue_events_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/events{/number}","events_url":"https://api.github.com/repos/scala-ide/scala-ide/events","assignees_url":"https://api.github.com/repos/scala-ide/scala-ide/assignees{/user}","branches_url":"https://api.github.com/repos/scala-ide/scala-ide/branches{/branch}","tags_url":"https://api.github.com/repos/scala-ide/scala-ide/tags","blobs_url":"https://api.github.com/repos/scala-ide/scala-ide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-ide/scala-ide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-ide/scala-ide/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-ide/scala-ide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-ide/scala-ide/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-ide/scala-ide/languages","stargazers_url":"https://api.github.com/repos/scala-ide/scala-ide/stargazers","contributors_url":"https://api.github.com/repos/scala-ide/scala-ide/contributors","subscribers_url":"https://api.github.com/repos/scala-ide/scala-ide/subscribers","subscription_url":"https://api.github.com/repos/scala-ide/scala-ide/subscription","commits_url":"https://api.github.com/repos/scala-ide/scala-ide/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-ide/scala-ide/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-ide/scala-ide/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/comments/{number}","contents_url":"https://api.github.com/repos/scala-ide/scala-ide/contents/{+path}","compare_url":"https://api.github.com/repos/scala-ide/scala-ide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-ide/scala-ide/merges","archive_url":"https://api.github.com/repos/scala-ide/scala-ide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-ide/scala-ide/downloads","issues_url":"https://api.github.com/repos/scala-ide/scala-ide/issues{/number}","pulls_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-ide/scala-ide/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-ide/scala-ide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-ide/scala-ide/labels{/name}","releases_url":"https://api.github.com/repos/scala-ide/scala-ide/releases{/id}","created_at":"2011-10-04T05:56:23Z","updated_at":"2014-09-24T17:36:35Z","pushed_at":"2014-10-07T09:33:23Z","git_url":"git://github.com/scala-ide/scala-ide.git","ssh_url":"git@github.com:scala-ide/scala-ide.git","clone_url":"https://github.com/scala-ide/scala-ide.git","svn_url":"https://github.com/scala-ide/scala-ide","homepage":"www.scala-ide.org","size":158367,"stargazers_count":361,"watchers_count":361,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":172,"mirror_url":null,"open_issues_count":6,"forks":172,"open_issues":6,"watchers":361,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820"},"html":{"href":"https://github.com/scala-ide/scala-ide/pull/820"},"issue":{"href":"https://api.github.com/repos/scala-ide/scala-ide/issues/820"},"comments":{"href":"https://api.github.com/repos/scala-ide/scala-ide/issues/820/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/820/commits"},"statuses":{"href":"https://api.github.com/repos/scala-ide/scala-ide/statuses/51db405b89355d6e050c019825dae4dbb4eb84f3"}}}}