- Bug spaceBeforeBraceInArrayInitializer sometimes doesn't

work.

- RFE Wrap single statements (for, while, do while, if).



Great. This bugs/features have been annoying me for a long time. Very good
work Timur.


It's only after starting using the plugin that I realized how REALLY annoyed
I was with the reformat/optimize actions.

Also, and as suspected (and suggested in a feature request) the confirmation
dialog doesn't add anything to the reformat/optimize actions.


Great work again.

Little feature request :)

The plugin works so well, that sometimes I press control-alt-r and stand in
doubt if the reformat has really gone through. How about a status message
"Reformat done" ?


0

Thank you!

Status message request. I added this request at SourceForge but I don't think it can be currently done ( http://www.intellij.net/tracker/idea/viewSCR?publicId=11579 ). BTW, I usually do the check (whether the plugin is installed) by Ctrl-Alt-L/O (the dialog means no plugin).


Timur

- Bug spaceBeforeBraceInArrayInitializer

sometimes doesn't
work.

- RFE Wrap single statements (for,

while, do while, if).


Great. This bugs/features have been annoying me for a
long time. Very good
work Timur.


It's only after starting using the plugin that I
realized how REALLY annoyed
I was with the reformat/optimize actions.

Also, and as suspected (and suggested in a feature
request) the confirmation
dialog doesn't add anything to the reformat/optimize
actions.


Great work again.

Little feature request :)

The plugin works so well, that sometimes I press
control-alt-r and stand in
doubt if the reformat has really gone through. How
about a status message
"Reformat done" ?


0

Status message request. I added this request at SourceForge but I don't

think it can be currently done (
http://www.intellij.net/tracker/idea/viewSCR?publicId=11579 ).

Ah. I remember the request now. Added a +1 to it.

BTW, I usually do the check (whether the plugin is installed) by

Ctrl-Alt-L/O (the dialog means no plugin).

I know it's there. It's only that as there isn't any feedback, I'm always
afraid the wrong keys have been pressed and no reformat has been done.


0

Awesome.
I've got all your plugins installed, and am using Camel and Reformat almost every second/minute.
XEmacs has a camelcase mode which I had gotten very used to, and so I was very fortunate you added the Camel plugin right when I picked up IntelliJ IDEA. Thank you.

- RFE Wrap single statements (for, while, do while, if).


I just tried this out:

if (true) int n = 0;

and it produced:

if (true) {int n = 0;}

which is good but I'd like it to produce:

if (true) {
int n = 0;
}

which is my code style. Is this an RFE, or do I not have something setup right?

Also, looking at the RFEs, this one is a big:

736791 Reformat code should be able to reorder methods
http://www.intellij.net/tracker/idea/viewSCR?publicId=4733

IntelliJ has an excellent configuration of the import statements, allowing to specify the order. I'm surprised they don't have anything for the fields and methods, because that would also be very useful..

I can imagine a UI similar to the Code Style->Imports->Import Layout, but more compilcated.

Class Layout
-


clone equals hashcode compareTo ... All groups of methods would be subsorted alphabetically. All leftover methods not matched by above rules would be included at the bottom. The Class Layout would also be applied to inner classes. The code style settings code be used so you don't have to explicity insert ]]> elements in the layout.
-Alex

0

Awesome.
I've got all your plugins installed, and am using
Camel and Reformat almost every second/minute.
XEmacs has a camelcase mode which I had gotten very
used to, and so I was very fortunate you added the
Camel plugin right when I picked up IntelliJ IDEA.
Thank you.


Thank you!

- RFE Wrap single statements (for,

while, do while, if).

I just tried this out:

if (true) int n = 0;

and it produced:

if (true) {int n = 0;}

which is good but I'd like it to produce:

if (true) {
int n = 0;
}

which is my code style. Is this an RFE, or do I not
have something setup right?


I wasn't able to reproduce it. I have the same code style settings for the sample, i.e. the result is the same. I tried:


with #705, #823 and #828 and I had the expected result.
Questions:
1) Any exceptions?
2) What build are you using?
3) What happens if you remove all other plugins and try?
4) What happens if you invoke the regular reformat action through the menu?
5) What happens if you try the action several times?
6) Does it happen for both Ctrl-Alt-R and Ctrl-Alt-L?

Also, looking at the RFEs, this one is a big:

736791 Reformat code should be able to reorder
methods
http://www.intellij.net/tracker/idea/viewSCR?publicId=
733

IntelliJ has an excellent configuration of the import
statements, allowing to specify the order. I'm
surprised they don't have anything for the fields and
methods, because that would also be very useful..

I can imagine a UI similar to the Code
Style->Imports->Import Layout, but more compilcated.

Class Layout
------------
<public static vars>
<all other static vars>
<public vars>
<all other vars>
<public static methods>
<public constructors>
<public copy constructor>
clone
equals
hashcode
compareTo
<public getters and setters>
<public other methods>
...
<inner classes>

All groups of methods would be subsorted
alphabetically. All leftover methods not matched by
above rules would be included at the bottom. The
Class Layout would also be applied to inner classes.
The <blank line> code style settings code be used so
you don't have to explicity insert <blank line>
elements in the layout.
-Alex


I assigned the lowest priority to this RFE mainly because it's a complex request and will probably take a lot of time. Though some day maybe I'll start moving in this direction (or maybe it will be implemented by JetBrains or some other plugin writer). See also http://www.intellij.net/forums/thread.jsp?forum=18&thread=29238 (search for 'reordering')


Timur

0

=====================================================
I wasn't able to reproduce it. I have the same code style settings for the sample, i.e. the result is thesame. I tried:

=====================================================

When I use Tools->Reformat I get

When I use Reformat Plugin (CTRLALTR):




==Questions:
==1) Any exceptions?

No exceptions.

==2) What build are you using?

823

==3) What happens if you remove all other plugins and
== try?

The same problem happens when I only have Reformat
plugin loaded, and no other plugins.

==4) What happens if you invoke the regular reformat ==action through the menu?

See above.

==5) What happens if you try the action several times?

2nd and successsive times have no effect.

==6) Does it happen for both Ctrl-Alt-R and Ctrl-Alt-L?

Yes, happens for both CTRLALTR and CTRLALTL

I'm a bit confused how it could work for you and not for me. Must be some difference in the code style settings?

-Alex


0

=================================================
I assigned the lowest priority to this RFE mainly because it's a complex request and will probably take a lot of time. Though some day maybe I'll start moving in this direction (or maybe it will be implemented by JetBrains or some other plugin writer). See also http://www.intellij.net/forums/thread.jsp?forum=18&thread=29238 (search for 'reordering')
=================================================

Yes, it really makes sense for JetBrains to implement something as complicated as Class Layout settings.

The Tracker already has 563 votes! Maybe they'll get around to it someday if they don't get bogged down in UI designer and AspectJ.. I added my comments and votes to the request.

!!! Reformat code should be able to reorder methods !!!!
http://www.intellij.net/tracker/idea/viewSCR?publicId=4733

0

I just installed 883, and the problem is still there.
Here is another example:

If I select Tools->Reformat

if I press CTRLALTR :

0

Can you please try Tools->Reformat on this:


and post the result?

0

I think you enabled 'IDE Settings->Code Style->Work In Progress->Other->Keep simple blocks in one line'.

0

======================================================
>I think you enabled 'IDE Settings->Code Style->Work In >Progress->Other->Keep simple blocks in one line'.
======================================================

Yes! That was it. I turned it off and then it worked.

The difference in behavior between Tools->Reformat and CTRLALTR when 'Keep simple blocks in one line' is turned on, is that Tools->Reformat will not reformat statements like

to

whereas CTRLALTR will. CTRLALTRR behaves more like "Force simple blocks in one line".

I could see someone might like that behavior if they wanted to format everything in one line. For me, I like to have them on separate lines.

The meaning of that option was confusing in the Works in Progress panel becuase when you set Keep simple blocks on same line, the only change in the Preview pane was to change {\n} to {}

There is another setting General->Keep When Reformatting->Control statement in one line
====================================================
If checked, control statements (like if, for) typed within braces on one line will not be changed when the code is reformatted. Otherwise, each particular statement or expression will be moved to a separate line.
======================================================
This seems to be a similar setting; kind of confusing.

-Alex

0

The difference in behavior between Tools->Reformat
and CTRLALTR when 'Keep simple blocks in one line'
is turned on, is that Tools->Reformat will not
reformat statements like

 if (true) 
>     int n = 0;
> ]]>

to

 if (true) int n = 0;
> ]]>

whereas CTRLALTR will. CTRLALTRR behaves more
like "Force simple blocks in one line".


Try Tools->Reformat Code on


and see what happens ('if' statement on one line). The plugin (with the option turned on) just inserts '{' and '}', the rest is done by the regular action (Tools->Reformat Code).

0

Tools->Reformat and CTRLALTR both produce:


but on this sample they do something different:

Tools->Reformat does nothing while CTRLALTR not only adds the braces but also moves it to a newline:


This is with settings
Reformat->wrapSingleStatements=true,
Keep single blocks in one line=false
General->Keep When Reformatting->Control Statment in one line=true

If I make Control Statement in one line=false, then they do they same thing (except for the braces). Tools->Reformat does:


I think I understand the settings now. I don't know why the CTRLALTRR doesn't respect the Control Statment in one line=true if you are just calling Tools->Reformat yourself....

-Alex

0

"I don't know why the CTRLALTRR doesn't respect the Control Statment in one line=true if you are just calling Tools->Reformat yourself....".

It's easy to check: insert '{' and '}' and do 'Tools->Reformat Code'. For example, try


with your settings:
"Reformat->wrapSingleStatements=true,
Keep single blocks in one line=false
General->Keep When Reformatting->Control Statment in one line=true".

I have this result:

0

请先登录再写评论。