scala-ide/scala-ide — pull request #770 by sschaef (2014-08-25 23:25:07+00:00)
Title: Auto edits

This PR is rebased on my save actions PR #761, because it is built on top of the new API. All in all it is quite huge, but most new code is related to implementations of save actions and auto edits, the changes to the existing code base are not that much.

Overview:
- New feature: Auto edits. They are a more powerful replacement for Eclipse' auto edit strategies (subtypes of `IAutoEditStrategy`). The main difference users can see, is that a [linked model](http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Ftext%2Flink%2Fclass-use%2FLinkedModeModel.html) is created once the auto edit is applied.
- Some auto edit strategies are ported to the new API; some entirely new auto edits are created (my personal favorite: [ApplyTemplate](https://github.com/sschaef/scala-ide/blob/2bc28110838707320222b96545f9e684cac6c0da/org.scala-ide.sdt.core/src/org/scalaide/extensions/autoedits/ApplyTemplate.scala) - automatically expand a template by pressing tab).
- New menu entry in the preferences:
![auto-edit-pref](https://cloud.githubusercontent.com/assets/488530/4037997/e50850ee-2cac-11e4-83dd-6aec9decb52e.png)

Implementation details:
- All auto edits are placed in `org.scalaide.extensions`
- The auto edits are loaded in `org.scalaide.ui.internal.editor.AutoEditExtensions`, which is referenced in `ScalaSourceFileEditor`.

Todos:
- [ ] More Scaladoc needs to be written (I first want to get more review on the design of the new text API, introduced in #761)
- [ ] The table in the preference page doesn't grow correctly (scroll bar missing)
- [ ] Lost functionality: Move braces to correct position. Should be reintroduced (and fixed together with [1002133](https://www.assembla.com/spaces/scala-ide/tickets/1002133#/activity/ticket:))