there's something I come across ever so often when I program in Scala: I'm writing a call to a higher order function, say map I enter a paren (a matching paren appears) then I start typing the anonymous function body. Then I realize that I need to declare a temporary val inside the function because the expression is getting too complex. So I get back to the opening paren and replace it with a curly brace. A pair of matching braces appears. The closing brace makes no sense in this place so I delete it promptly. But! The code is not syntactically valid anymore, there's an unbalanced closing parent, so I need to move cursor to it and replace it also. Sometimes though the closing paren is hiding among several closing parens next to one another, and the IDE helpfully highlights the last one... This makes the whole procedure a bit tedious and breaks my mental flow.
It would be much more convenient if a quick fix "change ( to {" was available whenever a pair of matching parens is highlighted, and conversely "change { to (" quick fix was available whenever a pair of matching curly braces was highlighted, provided that the braces enclose a single expression. The assist actions would of course flip both parens/braces at the same time, and would be available when the cursor is either at the opening or closing paren/brace.
A variation of that would be flipping the matching paren/brace automatically whenever a paren/brace character is overwritten with the other one, using overwrite mode (I mean the opposite of insert), or replacing a single character selection. That would also be cool, there are more possibilities of unforeseen problems or triggering it unintentionally.
It would be much more convenient if a quick fix "change ( to {" was available whenever a pair of matching parens is highlighted, and conversely "change { to (" quick fix was available whenever a pair of matching curly braces was highlighted, provided that the braces enclose a single expression. The assist actions would of course flip both parens/braces at the same time, and would be available when the cursor is either at the opening or closing paren/brace.
A variation of that would be flipping the matching paren/brace automatically whenever a paren/brace character is overwritten with the other one, using overwrite mode (I mean the opposite of insert), or replacing a single character selection. That would also be cool, there are more possibilities of unforeseen problems or triggering it unintentionally.
Leave a comment
on 2014-09-24 01:52 *
By Simon Schäfer
Type changed from Defect to Enhancement
Version changed from 3.0.4-211 to 4.0.0-211
on 2014-09-24 02:38 *
By Iulian Dragos
Great idea!
on 2014-10-20 14:34 *
By rafal.krzewski
It turns out the same exetension was proposed earlier: #1001019
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|