Bug 3920 - Formatter can't handle selections starting in comments (1GF5XQK)
Summary: Formatter can't handle selections starting in comments (1GF5XQK)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P4 major (vote)
Target Milestone: 3.0   Edit
Assignee: Tobias Widmer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 23:03 EDT by Erich Gamma CLA
Modified: 2003-10-06 04:02 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 Erich Gamma CLA 2001-10-10 23:03:03 EDT
TM (6/11/2001 17:26:11)
	sdk 122

	1) smoke test setup
	2) open LoadingTestRunner.java
	3) select lines from the second line of the comment of main(String[]) down to (including) the 
		line containing the method name.
	4) format
	5) observe: the formatting leaves the comment open, thus making the rest of the CU a comment.

EG (7/12/01 10:54:50 AM)
	the formatter selection should be extended to full lines
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:14:10 EDT
moved to 'active'
Comment 2 Erich Gamma CLA 2001-11-10 17:01:24 EST
still a problem
Comment 3 Dani Megert CLA 2002-02-27 10:47:43 EST
Still a problem but a corner case. Leaving P4.
Comment 4 Erich Gamma CLA 2002-05-04 16:26:59 EDT
deferring
Comment 5 Dirk Baeumer CLA 2002-07-25 12:43:37 EDT
Moving to core
Comment 6 Olivier Thomann CLA 2002-07-29 11:16:54 EDT
I think this is a minor defect, if it is a defect. The selected code should be a
valid piece of Java code. There is no way for the formatter to guess that the
selection is in the middle of a comment. So the first '*' will be seen an
operator and not as the line in a comment.
The refactoring has such limitation to select a valid piece of code, so it
should be the same thing for the formatter.
The whole comment should be selected, not just a part of it.
Comment 7 Olivier Thomann CLA 2003-01-15 13:23:11 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:51 EDT
Resurrecting for 3.0
Comment 9 Olivier Thomann CLA 2003-06-12 15:59:04 EDT
Reopen for 3.0 consideration.
Comment 10 Olivier Thomann CLA 2003-10-03 09:11:01 EDT
This has to be handled by the UI. For new formatter, simply return edits.
The new formatter won't be able to start directly in the middle of a comment.
Move to JDT/UI for comment.
Comment 11 Dani Megert CLA 2003-10-03 10:05:09 EDT
Tobias, this should now work, right?
Comment 12 Tobias Widmer CLA 2003-10-03 12:15:55 EDT
The new content formatter automatically expands the region to be formatted to 
partition boundaries and, if starting with default content type partition, also 
block-aligns the region.
The content formatter therefore uses the code formatter exactly the way 
Ctrl+Shift+F5 does. The comment formatter only "patches" the comment regions 
afterwards.
Comment 13 Tobias Widmer CLA 2003-10-06 04:02:09 EDT
Verified