Move closing brace automatically to end of block
Following example:
Inserting an opening brace in the function header of
Since this example is indented properly the IDE should not have a problem in recognizing the end of a function even without semantic analysis. Therefore it should insert the closing brace at the correct position.
object X extends App {
def f() =
if (true)
1
else
0
}
Inserting an opening brace in the function header of
f
either inserts the closing brace immediately at the same position or in the next line when enter is pressed. Both cases are not useful because they produce a compilation error. In this case the only real point where it makes sense to introduce the closing brace is after the if-expression.Since this example is indented properly the IDE should not have a problem in recognizing the end of a function even without semantic analysis. Therefore it should insert the closing brace at the correct position.
Leave a comment
on 2014-08-25 23:19 *
By Simon Schäfer
Description changed from Following example:
to Following example:
on 2014-12-20 01:12 *
By Simon Schäfer
Version changed from 4.0.0-211 to 4.0.0
Assigned to set to Simon Schäfer
Add auto edit that adds closing curly brace to end of block
I can't say how I like this feature. It is just a heuristic because
we can't really parse the document in order to find the end of an
expression but it should work fine in most cases nevertheless.
Fixes #1002133
Branch: master
Commit: scala-ide:a0647db681
I can't say how I like this feature. It is just a heuristic because
we can't really parse the document in order to find the end of an
expression but it should work fine in most cases nevertheless.
Fixes #1002133
Branch: master
Commit: scala-ide:a0647db681