Quick Fixes updated

Quick Fix Import

Quick Fix can be used to easily add a required import statement.

../../../_images/feature-quickfix-import-012.png

Expand Implicit Conversion

Note

Implicit Highlighting needs to be enabled.

Quick Fix can be used to expand an implicit conversion.

../../../_images/quick-fix3.png

Create Method and Class new

For the following code snippet there exists a quick fix for the method call of g:

../../../_images/create-method.png

The result of applying this quick fix is the following:

object Test extends App {

  def f() {
    val value = g("a string")
  }

  def g(arg: String) = {
    ???
  }
}

As one can see in the screenshot above it is also possible to create classes, not only methods.

Change Capitalization new

If one did a type error in the name of a method, it is possible to correct this as long as the only type error is due to wrong capitalization:

../../../_images/change-capitalization.png

Add Explicit Type new

If you want to add an explicit type to a method or a value definition, you can automatically add the inferred type. Position the cursor on the value or method definition and type Ctrl-1 (or CMD for Macs). You should see a popup offering to add the explicit type, like the in the picture below:

../../../_images/explicit-type.png