Community
Participate
Working Groups
Using integration build eclipse-SDK-I20040310-win32, I was not able to format a java file with just one java function in it. I was able to do that in Eclipse 2.1.3. I noticed that this integration build is using the new MultiPassContentFormatter. So, is it just a bug, or the function has been removed?
The new code formatter requires a syntactically correct Java program. So if you file just contained a method declaration but was not inside a type, then this doesn't work anymore. Note that programatically you can still format just a method, but you now always have to give this context information to the formatter. Please reopen if I misunderstood your request.
This sounds like a step backwards. I used the Java formatter to format the JSP Java partitions in a JSP file. That worked in Eclipse 2.1.3, but won't work in 3.0. If you were talking about using the "format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator)" API to format a method (by specifying the "kind" of the code snippet to format), that may not work for us because all we know is the JSP Java contains some Java snippets. Any suggestions?
p.s. The Java statement in a JSP Java partition may not be complete. We may have half of a "if" statement (like "if (condition) {") in one partition, and another half (like "statement;}") in another partition.
Moving to JDT/Core.
There is no plan to provide support for formatting incomplete piece of code. Close as WONTFIX
closing resolved bug