Bug 256799 - [formatter] Formatter wrongly adds space to //$FALL-THROUGH$ is
Summary: [formatter] Formatter wrongly adds space to //$FALL-THROUGH$ is
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-27 11:01 EST by Dani Megert CLA
Modified: 2008-12-09 13:46 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch (11.46 KB, patch)
2008-12-03 15:48 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2008-11-27 11:01:42 EST
N20081126-2000.

The formatter wronglys adds space to //$FALL-THROUGH$ i.e. it becomes:
// $FALL-THROUGH$

The correct format we agreed upon is //$FALL-THROUGH$ without a space.
Comment 1 Frederic Fusier CLA 2008-12-01 07:07:08 EST
What should we do for the block comment tag /*$FALL-THROUGH$*/ which currently is formatted as:
/* $FALL-THROUGH$ */
(i.e. like an usual block comment)?
Comment 2 Dani Megert CLA 2008-12-01 07:13:23 EST
You could do the same as for NON-NLS: there it looks as if you don't touch the current formatting i.e. if I write //$NON-NLS or // $NON-NLS it is both honored/not touched. Same could be done for fall-through.
Comment 3 Frederic Fusier CLA 2008-12-03 15:48:54 EST
Created attachment 119428 [details]
Proposed patch

If I agreed for line comment to behave like NON-NLS tag, I do not think this add any value for user to do the same for block comment. Set fall through tags using block comment is not recommended, just tolerated by the compiler. So, we can let the formatter considering them as usual block comment, hence systematically adds space at the beginning and at the end of the comment...
Comment 4 Frederic Fusier CLA 2008-12-04 06:08:33 EST
Released for 3.5M4 in HEAD stream.
Comment 5 Kent Johnson CLA 2008-12-09 13:46:25 EST
Verified for 3.5M4 using I20081209-0100