Community
Participate
Working Groups
Currently, there's two places where the inserting a tab/space and amounts are configured for the Java environment; in the Code Formatter and the Editor. Further, the editor's preference (insert spaces for tabs) seems to be diametrically opposite to the Code Formatter's Style (use tab for indentation). Ideally, there should only be one place where the configuration is made for tabs/spaces, and number of spaces. (i.e. either the TAB inserts x spaces, or a TAB represents x spaces).
This is even worse for 2.1M5 now. Tabs/spacing is an issue in many types of text file, and IMHO Eclipse doesn't really do them any justice. For example; there are separate indentation conventions for both whether tabs and spaces are used, and what the indentation is, in the Java type. Preferences>Java>Editor-Typing: insert spaces for tabs Preferences>Java>Editor-Appearance: displayed tab width Preferences>Java>Code formatter-Style: insert tabs for spaces Preferences>Java>Code formatter-Style: number of spaces indicating tab These seem to not only be duplciates, but also the insert spaces-for-tabs and tabs-for-spaces are reversed. These changes were introduced in recent modifications with the Code Formatter. Ideally, they should be handled by the same preference dialog; if they are shared with the code formatter/editor, then why not promote them to the parent (Java) development? I'd like to see the duplicate configuration places commented on as part of the 2.1RC0/1 process if someone can view this. I have changed the bug from 'enhancement' to 'minor' since the changes since this bug was opened have made it more of an issue. In later versions of Eclipse, it would make sense to have a generic editor preferences configuration box in Eclipse, and then (if necessary) have as sub Java/XML/Whatever child from that, rather than a specific Java/Editor; in other words, use: + Editor <- tab/space configuration, general fonts (comments, string literals etc) - Java <- preferences with Java editors (formatting, close brace etc.) - XML <- location of DTDs etc instead of + Java - Editor + XML - Editor Obviously the updgraded functionality probably won't make it into the 2.1 build, but addressing the dual configuration options probably should be. I know that the Eclipse implementation for 'code formatter' and 'editing shortcuts' are in different pieces of code, but as far as the end user is concerned these are indistinguishable from the way they use it. If I press TAB and it inserts a TAB in editing mode, I'd be annoyed if it changed those to spaces (and vice versa).
The same could also be applied for the font and colour for each of the editors; for example, there could be a standard 'comment' colour, a standard 'keyword' colour, a standard 'identifier' colour etc. It would also then make it more accessible for other editing types to be added (e.g. XML) because they could reuse the same text-types (comment, identifier etc.) rather than having to provide an extra editing type for it.
*** Bug 30962 has been marked as a duplicate of this bug. ***
*** Bug 42852 has been marked as a duplicate of this bug. ***
Bug 19036 is a duplicate of this one.
*** This bug has been marked as a duplicate of 19036 ***
Verified duplicate after transferring important comments to dup bug.