Complete current statement improvements

The "complete current statement" is a great thing in IDEA. Since it first appeared I've mapped it to Enter and use it everyday. However, it's functionality seems to have been changing slowly since a few builds ago.

I'll list here (and reply sometimes, as I remember specific points) what have been bothering me about "complete current statement" (CCS frow now on). You guys let me know what you think about each behavior, and if I should or not open a SCR about this.


1. Wrong introducing braces behavior:

If I'm typing a new method name, say:

and activate CCS, here's what I get:

Where, of course, "|" means the cursor. This is awkward: there should be no extra lines between the method name and the opening brace, and the cursor should be put between the braces, like this:



2. Code reformatting. It seems that CCS triggers code reformatting on some special situations. Here's a specific scenario:

When triggering CCS on the above code, it will reformat the whole block:

I don't think CCS should ever reformat code. This is specially cumbersome when dealing with other people's code. When editing other people's code I avoid to do any reformatting, no matter how badly formatted the code is: I want to keep the change set at a minimal.

That's it, for now. These two nags have been making CCS a lot less pleasant to me than it could be. I think there are other small problems, which I'll add to this thread as I come by them.

Please sign in to leave a comment.