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

Bug 145937

Summary: Code paste suppresses white space in line comments that preceede a method declaration
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Maxime Daniel CLA 2006-06-08 02:38:20 EDT
Version: 3.2.0
Build id: I20060602-1317

Here are the results of a copy paste of the four lines that comprise the first comment and foo's definition, using different preferences:

// Foo comment
void foo() {
	
}
// pasting with Java/Editor/Typing/When pasting/Adjust indentation on:
//Foo comment
void bar() {
	
}
// pasting with Java/Editor/Typing/When pasting/Adjust indentation off:
// Foo comment
void foobar() {
	
}

I do not want the white space to be suppressed (as in the first case). Switching Ajust indentation off is a workaround, but this is quite a bit annoying, since it also disactivates the formatting of the code. 
I searched a bit for an option that would let me tell the formatter if I want to keep the leading white space in line comments or not, but I could not find it.
If no such option exists, I would suggest that the paste preserve the leading white space in line comments (if any), regardless of the 'Adjust indentation' preference.
Comment 1 Dani Megert CLA 2006-06-08 03:03:06 EDT

*** This bug has been marked as a duplicate of 65841 ***