Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 26270 - [preferences] Should only be a single place for specifying tab/spaces/width amounts
Summary: [preferences] Should only be a single place for specifying tab/spaces/width a...
Status: VERIFIED DUPLICATE of bug 19036
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: PC All
: P3 minor with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 30962 42852 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-14 07:02 EST by Alex Blewitt CLA
Modified: 2004-06-14 08:54 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2002-11-14 07:02:34 EST
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).
Comment 1 Alex Blewitt CLA 2003-02-20 10:43:37 EST
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).
Comment 2 Alex Blewitt CLA 2003-04-03 04:24:54 EST
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.
Comment 3 Dani Megert CLA 2004-01-13 02:52:19 EST
*** Bug 30962 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2004-02-23 12:07:00 EST
*** Bug 42852 has been marked as a duplicate of this bug. ***
Comment 5 Jim Kingdon CLA 2004-06-13 23:36:30 EDT
Bug 19036 is a duplicate of this one.
Comment 6 Tom Hofmann CLA 2004-06-14 01:27:19 EDT

*** This bug has been marked as a duplicate of 19036 ***
Comment 7 Alex Blewitt CLA 2004-06-14 08:54:25 EDT
Verified duplicate after transferring important comments to dup bug.