I love the new pressing-return-in-a-line-comment behavior

It's going to be hard to get out of my Enter, Home, Slash, Slash, Spacebar habit though.

IDEA guys: are you ever going to implement automatic word wrapping, more along the lines of traditional text document editor word wrapping?

I think it would be neat and would save me a lot of pressing return and backspace (HungryBackspace plugin helps this though) if maybe IDEA represented every statement internally as a single line, and wrapped it dynamically when displaying, and when saving to a file. So if I had the following line (dashes indicate the width of my margin, 80 columns):

I could delete the arrayName argument, and it would produce:

All this done automatically. I think this would be great - what do other people think? Will something like this go into Aurora before it's released, IDEA developers?

6 comments

By "Delete the argument" I mean I could just select it and press Backspace, or delete it with Backspace character by character, whatever.

0


Sounds interesting. Have you filed a feature request ?

On the other hand: if you open the same files with other editors, the code looks awful.

0

There would, of course, have to be a way to disable this. IDEA's abilities
to customize line wrapping behavior isn't sufficiently flexible to implement
our formatting rules, although it's getting closer. For instance, we like to
format method declarations with long argument lists like this:

public void doIt (
foo,
bar
) throws
AnException,
AnotherException
{
...
}

IDEA has no way to say the closing parenthesis should be outdented as shown.
Similarly, IDEA can't do this with class/interface declarations:

public class Sprocket
extends
Object
implements
Comparable,
Serializable
{
....
}

Generally, we like to format long lists one member per line (because they're
easier to change that way) and use indention to mark boundaries.

It would also be nice if IDEA could support another technique we like to
use--columnar alignment to improve visibility and stress the logical
relationships among elements on adjacent lines--as in sequences of
declarations in which the identifiers and assignment operators (if there are
initializers) on adjacent lines are aligned.

What an IDE really needs to support coding styles properly is some kind of
rule-based formatting engine. And ideally the formatting would be for
presentation only--that is, it wouldn't actually modify the line structure
or formatting of existing content (or perhaps the system would have separate
sets of formatting rules for presentation and persisted content). This would
put an end to the perennial conflicts over coding style--every user would
see the source formatted as he prefers.

"Keith Lea" <keith@cs.oswego.edu> wrote in message
news:21084154.1066790796675.JavaMail.itn@is.intellij.net...

It's going to be hard to get out of my Enter, Home, Slash, Slash, Spacebar

habit though.
>

IDEA guys: are you ever going to implement automatic word wrapping, more

along the lines of traditional text document editor word wrapping?
>

I think it would be neat and would save me a lot of pressing return and

backspace (HungryBackspace plugin helps this though) if maybe IDEA
represented every statement internally as a single line, and wrapped it
dynamically when displaying, and when saving to a file. So if I had the
following line (dashes indicate the width of my margin, 80 columns):
>

     public static void checkNullElements(Object[] array, String arrayName,
>             int offset, int len) throws IllegalArgumentException {]]>

I could delete the arrayName argument, and it would produce:

             throws IllegalArgumentException {]]>

All this done automatically. I think this would be great - what do other

people think? Will something like this go into Aurora before it's released,
IDEA developers?


0

IMHO this sounds like a great plugin, but a bad feature request

0

I think it sounds like a GREAT feature request, esp. Michael Besosa's idea of different rules for the presentation vs. persistance. I wouldn't have to care what our code style guidelines are, I could view my files the way I want, and store it the way the suits want, and everyone would be happy.

This does not sound like a simple change to IDEA, however, so I wouldn't expect it in Aurora (they seem to be about to start racing for the finish line anyway). But please file a feature request!

0

Please sign in to leave a comment.