Bug 3327 - Formatter - should ensure one empty line before a method declaration (1GHOJWD)
Summary: Formatter - should ensure one empty line before a method declaration (1GHOJWD)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 12004 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:53 EDT by Philipe Mulet CLA
Modified: 2003-10-13 07:56 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2001-10-10 22:53:17 EDT
class X {
	void foo(){}
	// comment

	void bar(){}
}

should format into:

class X {
									<--- ensure one empty line
	void foo(){
	}
									<--- ensure one empty line
	// comment				<--- no line in between comment and body
	void bar(){
	}
}

NOTES:

PM (7/30/2001 4:04:38 PM)
	We might want an option for this (maybe 2 options: one for empty line before comment/decl, and one for empty line between comment and decl).
Comment 1 Olivier Thomann CLA 2001-10-26 14:27:45 EDT
The formatter doesn't know what a method declaration is. It works only on 
tokens. In order to solve this problem, that implies that the code formatter 
knows when it reached a method declaration (a method header) or when it closes 
the last brace of a method declaration.
Comment 2 DJ Houghton CLA 2001-10-29 17:09:48 EST
PRODUCT VERSION:
0.9

Comment 3 Philipe Mulet CLA 2001-11-19 16:45:48 EST
Defer
Comment 4 Philipe Mulet CLA 2002-07-25 06:30:49 EDT
Resurrecting formatter issues in 2.1 stream.
Comment 5 Philipe Mulet CLA 2002-07-25 06:32:38 EDT
Clearing resolution
Comment 6 Olivier Thomann CLA 2002-07-30 13:53:38 EDT
*** Bug 12004 has been marked as a duplicate of this bug. ***
Comment 7 Olivier Thomann CLA 2003-01-15 13:22:43 EST
We need to clear 2.1 bug reports that won't be addressed before 2.1. The new 
implementation is still in the works. Therefore we cannot include it for 2.1. 
Not enough testing and we need to polish the preferences. This will be address 
for 2.2 as stated in the JDT/Core plan.
Comment 8 Philipe Mulet CLA 2003-06-12 06:35:52 EDT
Resurrecting for 3.0
Comment 9 Olivier Thomann CLA 2003-06-12 15:59:05 EDT
Reopen for 3.0 consideration.
Comment 10 Olivier Thomann CLA 2003-10-03 09:07:19 EDT
This is addressed in the new formatter.
Fixed and released in HEAD.
Regression test added.
Comment 11 David Audel CLA 2003-10-13 07:56:32 EDT
Verified.