Community
Participate
Working Groups
Build Identifier: 3.7.0 Build id: I20100805-1700 I have Eclipse set to use tabs instead of spaces (my choice) in the preferences (General->Editors->Text Editors, tab width is 4 and "Insert Spaces for Tabs" is unchecked). Yet when code is automatically added by Eclipse (e.g. when an error is shown and I select a suggested fix which adds code) then the code inserted completely ignores my tabs preference and uses spaces. Code added by Eclipse should honour the formatting and whitespace options that are in effect. An example is when a piece of code in a try block trows an exception with no catch defined. It shows as an error. However over and a quick fix option is add catch clause. This inserts a catch clause and block but the inserted code has spaces before the inserted lines. this is REALLY ANNOYING as I have to go through and hand change them all to tabs. Reproducible: Always Steps to Reproduce: 1. Set prefs to use tabs not spaces 2. Perform an action that causes Eclipse to add code automatically 3. Spend all day laboriously hand changing it to what you said you wanted in the first place 4. Grow old quickly and die young as an embittered shell of a person!
Is like this in all versions prior to and including 3.7M1
If you set your Java formatter to use spaces, this shouldn't be a problem.
You changed the settings for plain text editors. The Java editor has many more formatting options, and those have to be configured in Java > Code Style > Formatter.
Apologies but I missed the "Use spaces to indent wrapped lines" checkbox in the formatter indentation options. Having unchecked this it seems to work okay.