GitHub PullRequestReviewCommentEvent at 2014-08-14 07:17:34
Repository: scala-ide
Actor: misto
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/16224083","id":16224083,"diff_hunk":"@@ -0,0 +1,220 @@\n+package org.scalaide.extensions\n+\n+import scala.reflect.internal.util.SourceFile\n+import scala.tools.refactoring.common.InteractiveScalaCompiler\n+import scala.tools.refactoring.common.PimpedTrees\n+import scala.tools.refactoring.common.Selections\n+import scala.tools.refactoring.common.SilentTracing\n+import scala.tools.refactoring.sourcegen.CommentsUtils\n+import scala.tools.refactoring.sourcegen.EmptyFragment\n+import scala.tools.refactoring.sourcegen.Formatting\n+import scala.tools.refactoring.sourcegen.Fragment\n+import scala.tools.refactoring.sourcegen.Indentations\n+import scala.tools.refactoring.sourcegen.LayoutHelper\n+import scala.tools.refactoring.sourcegen.PrettyPrinter\n+import scala.tools.refactoring.sourcegen.ReusingPrinter\n+import scala.tools.refactoring.sourcegen.TreeChangesDiscoverer\n+import scala.tools.refactoring.transformation.Transformations\n+import scala.tools.refactoring.transformation.TreeFactory\n+import scala.tools.refactoring.transformation.TreeTransformations\n+\n+import org.scalaide.core.text.Change\n+import org.scalaide.core.text.Replace\n+import org.scalaide.core.text.TextChange\n+\n+trait CompilerSupport\n+    extends ScalaIdeExtension\n+    with Selections\n+    with InteractiveScalaCompiler\n+    with Transformations\n+    with TreeTransformations\n+    with PimpedTrees\n+    with TreeFactory\n+    with PrettyPrinter\n+    with Indentations\n+    with ReusingPrinter\n+    with LayoutHelper\n+    with Formatting\n+    with TreeChangesDiscoverer\n+    with SilentTracing {\n+\n+  import global._\n+\n+  /**\n+   * The selection of the active editor at the time when a save event occurs.\n+   *\n+   * '''ATTENTION''':\n+   * Do not implement this value by any means! It will be automatically\n+   * implemented by the IDE.\n+   */\n+  val selection: Selection\n+\n+  /**\n+   * Gives access to the underlying document.\n+   *\n+   * '''ATTENTION''':\n+   * Do not implement this value by any means! It will be automatically\n+   * implemented by the IDE.\n+   */\n+  val sourceFile: SourceFile\n+\n+  /**\n+   * Applies a transformation to the tree of the saved document.\n+   */\n+  final def transformFile(trans: Transformation[Tree, Tree]): Seq[Change] =","path":"org.scala-ide.sdt.core/src/org/scalaide/extensions/CompilerSupport.scala","position":64,"original_position":64,"commit_id":"d772a27dedbc932363a8dc4ea71d02920d4f2909","original_commit_id":"d772a27dedbc932363a8dc4ea71d02920d4f2909","user":{"login":"misto","id":2111,"avatar_url":"https://avatars.githubusercontent.com/u/2111?v=2","gravatar_id":"7c1bfcefe11cb78162dad7f506095640","url":"https://api.github.com/users/misto","html_url":"https://github.com/misto","followers_url":"https://api.github.com/users/misto/followers","following_url":"https://api.github.com/users/misto/following{/other_user}","gists_url":"https://api.github.com/users/misto/gists{/gist_id}","starred_url":"https://api.github.com/users/misto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/misto/subscriptions","organizations_url":"https://api.github.com/users/misto/orgs","repos_url":"https://api.github.com/users/misto/repos","events_url":"https://api.github.com/users/misto/events{/privacy}","received_events_url":"https://api.github.com/users/misto/received_events","type":"User","site_admin":false},"body":"The code looks very familiar to me, could we change scala refactoring so you don't have to copy paste as much code?","created_at":"2014-08-14T07:17:34Z","updated_at":"2014-08-14T07:17:34Z","html_url":"https://github.com/scala-ide/scala-ide/pull/761#discussion_r16224083","pull_request_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761","_links":{"self":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/16224083"},"html":{"href":"https://github.com/scala-ide/scala-ide/pull/761#discussion_r16224083"},"pull_request":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761"}}},"pull_request":{"url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761","id":19468449,"html_url":"https://github.com/scala-ide/scala-ide/pull/761","diff_url":"https://github.com/scala-ide/scala-ide/pull/761.diff","patch_url":"https://github.com/scala-ide/scala-ide/pull/761.patch","issue_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/761","number":761,"state":"open","locked":false,"title":"Save actions","user":{"login":"sschaef","id":488530,"avatar_url":"https://avatars.githubusercontent.com/u/488530?v=2","gravatar_id":"dd80aab570fdb5f37e62de5422f44ed4","url":"https://api.github.com/users/sschaef","html_url":"https://github.com/sschaef","followers_url":"https://api.github.com/users/sschaef/followers","following_url":"https://api.github.com/users/sschaef/following{/other_user}","gists_url":"https://api.github.com/users/sschaef/gists{/gist_id}","starred_url":"https://api.github.com/users/sschaef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschaef/subscriptions","organizations_url":"https://api.github.com/users/sschaef/orgs","repos_url":"https://api.github.com/users/sschaef/repos","events_url":"https://api.github.com/users/sschaef/events{/privacy}","received_events_url":"https://api.github.com/users/sschaef/received_events","type":"User","site_admin":false},"body":"This is not yet completely finished but because I already used it in production and it worked great so far I want to give you the possibility to play with it around as early as possible. In the following a short overview about what is included in this PR.\r\n\r\nFeatures included:\r\n\r\n- Java save actions do no longer work for Scala editors\r\n- Instead there are even better Scala save actions. They look like this:\r\n![sa-code](https://cloud.githubusercontent.com/assets/488530/3910926/763e033c-231c-11e4-9770-8703388e9799.png)\r\n\r\n- A preference page in `Scala → Editor → Save actions` where the save actions can be enabled/disabled:\r\n![sa-pref](https://cloud.githubusercontent.com/assets/488530/3910930/7c5b10d4-231c-11e4-8b39-4184373b7e73.png)\r\n\r\n- A timeout for save actions (can be configured in the preferences). This timeout keeps the editor responsive but can't abort the computation of the save action (in the worst case it means that a non returning save action will run until termination of Eclipse in a background thread)\r\n- Document driven (fast) and compiler driven (slow) save actions. The former usually operates in ~1-10ms, the latter more in ~50-timeout ms.\r\n\r\nDesign overview:\r\n\r\n- Package `org.scalaide.extensions` contains new API+save actions\r\n- Package `org.scalaide.core.text` also contains new API\r\n- Package `org.scalaide.core.internal.{text,extensions}` contains implementations of the API\r\n- Package `org.scalaide.ui.internal.editor` contains additions needed for save actions.\r\n- A new save action needs to be a `trait X extends SaveAction with {CompilerSupport,DocumentSupport}`\r\n- The save action needs to be enabled in `SaveActionExtensions.saveActionSettings` and in one of `SaveActionExtensions#{applyDocumentExtensions,applyCompilerExtensions}`\r\n\r\nDrawbacks/TODOs:\r\n\r\n- [x] The introduction of `ScalaDocumentProvider` broke several things\r\n   - [x] Implicit highlighting (`SemanticHighlightingReconciliation`)\r\n   - [x] Semantic highlighting extensions (participants)\r\n   - [x] Toggle breakpoint (in `ScalaToggleBreakpointAdapter`)\r\n   - [x] `BaseSemanticAction.refresh`\r\n   - [x] All other things, which call `JavaPlugin.getDefault.getWorkingCopyManager.getWorkingCopy`\r\n- [x] compiler accesses are not yet wrapped in askOption calls\r\n- [ ] API is not yet finished\r\n- [ ] No tests for the save actions yet\r\n- [ ] Resource leak when a save action never returns. I see possibilities to \"reactify\" the save action API because most functionality is hidden to users. But it is not yet implemented.\r\n- [ ] Bug in AddMissingOverride: [1002221](https://www.assembla.com/spaces/scala-ide/tickets/1002221#/activity/ticket:)","created_at":"2014-08-07T14:02:03Z","updated_at":"2014-08-14T07:17:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84ebbcd3a8eacb8db8192ab936a7effb6b19c013","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761/commits","review_comments_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761/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/761/comments","statuses_url":"https://api.github.com/repos/scala-ide/scala-ide/statuses/d772a27dedbc932363a8dc4ea71d02920d4f2909","head":{"label":"sschaef:save-actions","ref":"save-actions","sha":"d772a27dedbc932363a8dc4ea71d02920d4f2909","user":{"login":"sschaef","id":488530,"avatar_url":"https://avatars.githubusercontent.com/u/488530?v=2","gravatar_id":"dd80aab570fdb5f37e62de5422f44ed4","url":"https://api.github.com/users/sschaef","html_url":"https://github.com/sschaef","followers_url":"https://api.github.com/users/sschaef/followers","following_url":"https://api.github.com/users/sschaef/following{/other_user}","gists_url":"https://api.github.com/users/sschaef/gists{/gist_id}","starred_url":"https://api.github.com/users/sschaef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschaef/subscriptions","organizations_url":"https://api.github.com/users/sschaef/orgs","repos_url":"https://api.github.com/users/sschaef/repos","events_url":"https://api.github.com/users/sschaef/events{/privacy}","received_events_url":"https://api.github.com/users/sschaef/received_events","type":"User","site_admin":false},"repo":{"id":4021060,"name":"scala-ide","full_name":"sschaef/scala-ide","owner":{"login":"sschaef","id":488530,"avatar_url":"https://avatars.githubusercontent.com/u/488530?v=2","gravatar_id":"dd80aab570fdb5f37e62de5422f44ed4","url":"https://api.github.com/users/sschaef","html_url":"https://github.com/sschaef","followers_url":"https://api.github.com/users/sschaef/followers","following_url":"https://api.github.com/users/sschaef/following{/other_user}","gists_url":"https://api.github.com/users/sschaef/gists{/gist_id}","starred_url":"https://api.github.com/users/sschaef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschaef/subscriptions","organizations_url":"https://api.github.com/users/sschaef/orgs","repos_url":"https://api.github.com/users/sschaef/repos","events_url":"https://api.github.com/users/sschaef/events{/privacy}","received_events_url":"https://api.github.com/users/sschaef/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sschaef/scala-ide","description":"Scala IDE for Eclipse","fork":true,"url":"https://api.github.com/repos/sschaef/scala-ide","forks_url":"https://api.github.com/repos/sschaef/scala-ide/forks","keys_url":"https://api.github.com/repos/sschaef/scala-ide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sschaef/scala-ide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sschaef/scala-ide/teams","hooks_url":"https://api.github.com/repos/sschaef/scala-ide/hooks","issue_events_url":"https://api.github.com/repos/sschaef/scala-ide/issues/events{/number}","events_url":"https://api.github.com/repos/sschaef/scala-ide/events","assignees_url":"https://api.github.com/repos/sschaef/scala-ide/assignees{/user}","branches_url":"https://api.github.com/repos/sschaef/scala-ide/branches{/branch}","tags_url":"https://api.github.com/repos/sschaef/scala-ide/tags","blobs_url":"https://api.github.com/repos/sschaef/scala-ide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sschaef/scala-ide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sschaef/scala-ide/git/refs{/sha}","trees_url":"https://api.github.com/repos/sschaef/scala-ide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sschaef/scala-ide/statuses/{sha}","languages_url":"https://api.github.com/repos/sschaef/scala-ide/languages","stargazers_url":"https://api.github.com/repos/sschaef/scala-ide/stargazers","contributors_url":"https://api.github.com/repos/sschaef/scala-ide/contributors","subscribers_url":"https://api.github.com/repos/sschaef/scala-ide/subscribers","subscription_url":"https://api.github.com/repos/sschaef/scala-ide/subscription","commits_url":"https://api.github.com/repos/sschaef/scala-ide/commits{/sha}","git_commits_url":"https://api.github.com/repos/sschaef/scala-ide/git/commits{/sha}","comments_url":"https://api.github.com/repos/sschaef/scala-ide/comments{/number}","issue_comment_url":"https://api.github.com/repos/sschaef/scala-ide/issues/comments/{number}","contents_url":"https://api.github.com/repos/sschaef/scala-ide/contents/{+path}","compare_url":"https://api.github.com/repos/sschaef/scala-ide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sschaef/scala-ide/merges","archive_url":"https://api.github.com/repos/sschaef/scala-ide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sschaef/scala-ide/downloads","issues_url":"https://api.github.com/repos/sschaef/scala-ide/issues{/number}","pulls_url":"https://api.github.com/repos/sschaef/scala-ide/pulls{/number}","milestones_url":"https://api.github.com/repos/sschaef/scala-ide/milestones{/number}","notifications_url":"https://api.github.com/repos/sschaef/scala-ide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sschaef/scala-ide/labels{/name}","releases_url":"https://api.github.com/repos/sschaef/scala-ide/releases{/id}","created_at":"2012-04-13T23:03:01Z","updated_at":"2014-07-01T00:06:56Z","pushed_at":"2014-08-13T18:50:04Z","git_url":"git://github.com/sschaef/scala-ide.git","ssh_url":"git@github.com:sschaef/scala-ide.git","clone_url":"https://github.com/sschaef/scala-ide.git","svn_url":"https://github.com/sschaef/scala-ide","homepage":"www.scala-ide.org","size":145185,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scala-ide:master","ref":"master","sha":"75f3e2689c2d09732c6937a80c071230afdaa455","user":{"login":"scala-ide","id":1026788,"avatar_url":"https://avatars.githubusercontent.com/u/1026788?v=2","gravatar_id":"77d2c67b2d3b400cc8fa55624b67a232","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":"77d2c67b2d3b400cc8fa55624b67a232","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-08-14T00:59:24Z","pushed_at":"2014-08-12T12:34:54Z","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":155868,"stargazers_count":353,"watchers_count":353,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":166,"mirror_url":null,"open_issues_count":11,"forks":166,"open_issues":11,"watchers":353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761"},"html":{"href":"https://github.com/scala-ide/scala-ide/pull/761"},"issue":{"href":"https://api.github.com/repos/scala-ide/scala-ide/issues/761"},"comments":{"href":"https://api.github.com/repos/scala-ide/scala-ide/issues/761/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/761/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/761/commits"},"statuses":{"href":"https://api.github.com/repos/scala-ide/scala-ide/statuses/d772a27dedbc932363a8dc4ea71d02920d4f2909"}}}}