Bug 101996 - Issues with mixed tab formatting
Summary: Issues with mixed tab formatting
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-28 05:59 EDT by Philipe Mulet CLA
Modified: 2005-06-28 10:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2005-06-28 05:59:29 EDT
------- Additional Comment #23 From Robert (Kraythe) Simmons  2005-06-28 05:10
 [reply] -------

Reopening because "Mixed" mode tabs is still indenting improperly in RC3. The
whole point of mixed mode indenting is to make sure that code indented with tabs
appears the same on every machine no matter what the tab setting. 

Consider: 
	public void classifySet(final Set<?> objects, final int value, final long other,
	                        final int device) {
		for (final Object element : objects) {
			System.out.println(element.getClass().getName());
		}
	}

Note that the second line of the argument list is lined up using spaces after
the initial tab that lines it up with the numbers. There are no more tabs after
the first one. 

I have my tab size set at 4 but this editor has a tab size of 8 and you can see
if I paste in the "mixed" formatted text: 

	public void classifySet(final Set<?> objects, final int value, final long other,
							final int device) {
		for (final Object element : objects) {
			System.out.println(element.getClass().getName());
		}
	}
It doesnt line up because of the varied tab size. However my first example will
ALWAYS line up. 

The rule is simple. The phrase is inented to its block level with tabs but then
spaces are used to line things up. 



------- Additional Comment #24 From Thomas Singer 2005-06-28 05:20 [reply] -------

The whole point of tab-space mixture is to make the code looks well-aligned
independently of the defined tab-size. There are some rules:
- use tabs ONLY for leading indentation (convert all mid-line tabs to spaces)
- when lines are wrapped, like in Robert's example, tabs must be used like for
the first line of the wrapped statement, all further indentation must be spaces

Robert's example with ---> as tabs and . as (leading) spaces to illustrate:

--->public void classifySet(final Set<?> objects, final int value, final long other,
--->........................final int device) {
--->--->for (final Object element : objects) {
--->--->--->System.out.println(element.getClass().getName());
--->--->}
--->}
Comment 1 Philipe Mulet CLA 2005-06-28 06:00:26 EDT
These got added to bug 49896
Comment 2 Robert (Kraythe) Simmons CLA 2005-06-28 07:53:38 EDT
Should be marked as a duplicate of 49896 if this system has any remaining
credibility. 
Comment 3 Philipe Mulet CLA 2005-06-28 10:39:16 EDT
Closing as invalid. It got entered by mistake, see details in bug 49896