You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eclipse IDE for Java Developers (includes Incubating components)
Version: 2024-09 (4.33.0)
Build id: 20240905-0614
For a file that's indented normally, this is not an issue. However, I have some legacy code that I do want Eclipse to add @Override annotations to (for example) but not change the creative indentation.
Example Code:
package stuffs;
public class DoThings {
private static class A {
void foo() {
}
}
private static class B extends A {
void foo() {
}
}
}
The important thing here is that B.foo() is indented 2 spaces (it also occurs for 1 or 3 spaces).
Then I Source->Clean Up->Use configured profiles (Eclipse [build-in]) and Finish. The result is this:
package stuffs;
public class DoThings {
private static class A {
void foo() {
}
}
private static class B extends A {
@Override
void foo() {
}
}
}
Note that the void foo() declaration indentation is gone.
I can also reproduce this with adding @Deprecated annotation.
Formatting is set to the default Eclipse [built-in] option with Indentation being tabs of size 4. This also happens if I change the formatting to be "4 spaces" which is what we actually use in my project. The error occurs any time the method indentation is less than the declared indentation in the formatter (like I said, legacy code I don't want to bulk format at this time). However, I don't know that the formatting settings should have any effect, given that I'm only asking for a Clean Up, not a format.
The text was updated successfully, but these errors were encountered:
- add new method computeIndentInSpaces() to ASTRewriteFormatter
- modify ASTRewriteAnalyzer.rewriteModifiers2() to add spaces as
needed to separator of added annotation to match current indent
- needed for eclipse-jdt/eclipse.jdt.ui#1940
For a file that's indented normally, this is not an issue. However, I have some legacy code that I do want Eclipse to add
@Override
annotations to (for example) but not change the creative indentation.Example Code:
The important thing here is that B.foo() is indented 2 spaces (it also occurs for 1 or 3 spaces).
Then I Source->Clean Up->Use configured profiles (Eclipse [build-in]) and Finish. The result is this:
Note that the
void foo()
declaration indentation is gone.I can also reproduce this with adding
@Deprecated
annotation.Formatting is set to the default
Eclipse [built-in]
option with Indentation being tabs of size 4. This also happens if I change the formatting to be "4 spaces" which is what we actually use in my project. The error occurs any time the method indentation is less than the declared indentation in the formatter (like I said, legacy code I don't want to bulk format at this time). However, I don't know that the formatting settings should have any effect, given that I'm only asking for a Clean Up, not a format.The text was updated successfully, but these errors were encountered: