Replace () with {} and vice versa
See https://groups.google.com/d/topic/scala-ide-user/Q1tytYaqRoY/discussion
{...} can be replaced with () as long as it contains only one expression (not multiple statements).
(...) can be replaced with {} as long as it contains only one expression (not multiple arguments, nor tuples).
This is particularly useful when choosing a code completion. For example, when choosing `map`, the IDE will insert `{ x => ??? }`, but in some cases it makes more sense to use round parenthesis. It would be great to have a simple way to switch between the two. This could be an editor action that automatically changes the matching parenthesis, using linked-mode editing. Some example code using linked-mode editing already exists in code completion, in mkLinkedModeModel.
.
{...} can be replaced with () as long as it contains only one expression (not multiple statements).
(...) can be replaced with {} as long as it contains only one expression (not multiple arguments, nor tuples).
This is particularly useful when choosing a code completion. For example, when choosing `map`, the IDE will insert `{ x => ??? }`, but in some cases it makes more sense to use round parenthesis. It would be great to have a simple way to switch between the two. This could be an editor action that automatically changes the matching parenthesis, using linked-mode editing. Some example code using linked-mode editing already exists in code completion, in mkLinkedModeModel.
.
Leave a comment
on 2012-05-10 05:34 *
By Mirco Dotta
Component changed from Refactoring to Quick Fix
Estimate changed from 1.0 to 0.0
Milestone set to Enhancements
Sum of child estimates changed from 1.0 to 0.0
on 2014-10-20 16:03 *
By Iulian Dragos
Version changed from 2.0.1-final-29 to 3.0.4-211
Tags added starter
Description changed from See https://groups.google.c... to See https://groups.google.c...
on 2015-03-13 22:15 *
By Simon Schäfer
Eclipse version changed from All to Luna - Eclipse 4.4
Version changed from 3.0.4-211 to 4.0.0
Milestone changed from Enhancements to -none-