Strange Formatting in 10.5
Haven't updated yet, as I got pulled into a non-java project. However, I came back to my trustworthy IDEA to do some quick java work and my world changed.
I have something simple like this:
double values[] = {1, 2, 3, 4, 5};
double newValues[] = new double[values.length];
I type my 'itar' live template key to generate a for look for the values array, and I get back this:
for(
int i = 0;
i<values.length;i++)
{
double value = values[i];
}
Any idea why this for loop is broken up over 7 lines instead of what I was expecting:
for(int i=0; i<values.length; i++{
double value = values[i];
}
I checked out the settings for Wrapping and Braces under the 'for90' section, and everthing seems set correctly. and I don't remember making any changes.
Thanks for any help you can provide.
"Look away for just a little while...."
Thanks,
Eric
---
Original message URL: http://devnet.jetbrains.net/message/5460026#5460026
Please sign in to leave a comment.
Hi Eric,
Please check if the template definition contains those unexpected line feeds - IDE Settings | Live Templates | Iteration | itar
Denis
Denis,
My apologies. I thought I successfully deleted this thread shortly after creating it. I was not paying attention. It formatted that way because I was within a class but outside of any method when I typed my 'itar'. I was asleep at the wheel.
Good:
public class Main {
public static void main(String[] args) {
double values[] = {1, 2, 3, 4, 5};
double newValues[] = new double[values.length];
for (int i = 0; i < newValues.length; i++) {
double newValue = newValues[i];
}
}
}
Bad:
public class Main {
double values[] = {1, 2, 3, 4, 5};
for(
int i = 0;
i<values.length;i++)
{
double value = values[i];
}
}
Duh!
Ok, thanks for the update.
Denis