JetBrains/kotlin — pull request #378 by dezgeg (2014-02-19 15:00:28+00:00)
Title: KT-4547: Convert between explicit lambda parameter and 'it'

This (incomplete) PR implements intentions for converting between explicit function literal parameters and the implicit 'it' parameter.

For the `array(1, 2, 3).filter { x -> x % 2 == 0 }` -> `array(1, 2, 3).filter { it % 2 == 0 }` direction, this is implemented by triggering a programmatic rename of the first parameter to `it`, and then removing the argument list from the lambda after the rename.
For the `array(1, 2, 3).filter { x -> x % 2 == 0 }` -> `array(1, 2, 3).filter { it % 2 == 0 }` direction, this is implemented by first adding an explicit parameter named `it` and then invoking the variable renaming GUI.

For some reason, the former currently only works in the IDE itself and the test itself is failing. For some reason, the programmatic rename is not finding any usages of the parameter. I also had to subclass RenameProcessor to do the removal of the parameter list afterwards (since the rename might be done asynchronously), which is probably not the best solution.

Also, the tests for the other transformation are a bit incomplete since I'd need to communicate with the interactive renamer somehow.