Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341491

Summary: Formatter tabs-vs-spaces policy should defer to primary text editing setting by default
Product: [Eclipse Project] JDT Reporter: Jesse Hutton <jesselist>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jesse Hutton CLA 2011-03-31 10:27:00 EDT
Build Identifier: 20110218-0911

I had checked "insert spaces for tabs" in General -> Editors -> Text Editors. I found out later that I was still getting tabs inserted into my source code for indentation in some instances. After asking on IRC, I discovered the settings in Java -> Code style -> Formatter was to use tabs, so whenever I cleaned up the formatting of some of my source code using the format feature, it would insert tabs.

This seems confusing to me. By default the formatter should defer to the main preferences selection when considering tabs vs spaces.

And what is meant by "Mixed" mode in the formatter?

Reproducible: Always

Steps to Reproduce:
1. Set "insert spaces for tabs" in the general text editor preferences
2. Write some code
3. Auto format a portion of the code
4. Tabs will be inserted for that portion
Comment 1 Dani Megert CLA 2011-03-31 11:56:29 EDT
Sorry, the formatter preferences are provided by formatter profiles and we won't link them to the general preference.

"mixed" means you can have tabs and spaces.