Summary: | Code formatting not working half of the time | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Stefan Kuypers <stefan.kuypers> | ||||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||
Status: | RESOLVED WORKSFORME | QA Contact: | |||||||||
Severity: | major | ||||||||||
Priority: | P3 | ||||||||||
Version: | 3.0 | ||||||||||
Target Milestone: | 3.0 M8 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows NT | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Stefan Kuypers
2004-02-24 04:18:09 EST
Please include specific examples of where the code formatter is not giving you expected results. The JDT/Core team may also ask you for your settings. Are you referring to the code layout after doing a ctrl-shift-f or the auto-indent and formatting as you type in the java editor? Moving to JDT/Core. Please provide examples and code formatter settings. Without reproducable test cases, I will close it. Please attach test cases specifying what you expect and also attach your formatter settings. Created attachment 8268 [details]
Code formatter settings
Created attachment 8269 [details]
other formatter settings
Created attachment 8270 [details]
Test case to unzip
Well, I've just run into the same problem, and for me running the formatter with Ctrl-Shift-F stops working as soon as the code contains an assert statement - this was the minimal testcase I could come up with that shows it: public class Test { public Test() { //assert true; } } If you set the formatter settings to "Java Conventions", this'll get reformatted just as it should, but as soon as you remove the "//" from the comment it'll suddenly stop working (this is of course with Java 1.4 settings for the compiler). Of course, if you remove or comment out the assert statement the formatter starts working again. Hope this helps. np: The Orb - Outlands (Live 93) If you use build M7, you are in the same case than bug 52246. Please use a newer build. This is fixed since the 24th of February. If your code is not syntactically correct, it won't format. This is a restriction of the new formatter that is using an AST instead of just a steam of tokens. Please ensure your code is syntactically correct before running the formatter. Apparantly there is still another bug related to formatting the code. Changing version only helps in some cases. Stef Could you please be more specific? Please describe with examples the cases that are not working. The bug seems to be fixed in the latest integration build. Reopening to mark as WORKSFORME. Reporter said it now works. |