Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » CodeFormatter and line comment wrap in Ganymede RC
CodeFormatter and line comment wrap in Ganymede RC [message #254129] Sat, 21 June 2008 13:41 Go to next message
Eclipse UserFriend
Hello

The project I am working on right now is currently using Eclipse 3.3 and MDD
with MagicDraw UML and OAW 4.1 code generation. To seperate edited from
generated code we use the protected region approach, where two line comments
in the form of

// protected-region-start_[id=_123_456_789eaf_customSuffix]
// protected-region-end_[id=_123_456_789eaf_customSuffix]

mark the manually edited code areas. This style was explicitly chosen to
prevent the code formatter of Eclipse from wrapping these comment lines
(otherwise matching and preserving these regions wouldn't work), even if
they cross the line width threshold defined in our formatter configuration
due to indentation or long suffixes.

I recently switched to the 3.4 Release Candidates RC1 and RC4 to see wether
it would be safe for the project to migrate after 3.4 officially ships out.
Using the same formatter configuration with no new options regarding comment
formatting (as far as I know), JDT now wraps these line comments at either
"-", "=", "[" or "]", depending on the line width and actual length of
comment.

Unfortunately I couldn't find any documentation or bugs/issues related to
this change (or was unable to see the connection). I'd appreciate it if
anyone with could shed some light on wether this is the intended format
result or not.
Re: CodeFormatter and line comment wrap in Ganymede RC [message #254161 is a reply to message #254129] Mon, 23 June 2008 05:36 Go to previous message
Eclipse UserFriend
The comment formatter was completely rewritten for performance reason
(see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780).

We tried to keep the behavior as close as possible with previous comment
formatter but sometimes we unfortunately introduced some unexpected changes.

In your case, the change was due to the fact that the new comment formatter
try to split the comment line even if there's no white spaces in it
although the 3.3 comment formatter never splits such a line.

Please open a bug against JDT/Core component and I'll address this issue
as soon as possible, thanks

Axel Faust wrote:
> Hello
>
> The project I am working on right now is currently using Eclipse 3.3 and MDD
> with MagicDraw UML and OAW 4.1 code generation. To seperate edited from
> generated code we use the protected region approach, where two line comments
> in the form of
>
> // protected-region-start_[id=_123_456_789eaf_customSuffix]
> // protected-region-end_[id=_123_456_789eaf_customSuffix]
>
> mark the manually edited code areas. This style was explicitly chosen to
> prevent the code formatter of Eclipse from wrapping these comment lines
> (otherwise matching and preserving these regions wouldn't work), even if
> they cross the line width threshold defined in our formatter configuration
> due to indentation or long suffixes.
>
> I recently switched to the 3.4 Release Candidates RC1 and RC4 to see wether
> it would be safe for the project to migrate after 3.4 officially ships out.
> Using the same formatter configuration with no new options regarding comment
> formatting (as far as I know), JDT now wraps these line comments at either
> "-", "=", "[" or "]", depending on the line width and actual length of
> comment.
>
> Unfortunately I couldn't find any documentation or bugs/issues related to
> this change (or was unable to see the connection). I'd appreciate it if
> anyone with could shed some light on wether this is the intended format
> result or not.
>
>
Previous Topic:Re: target 1.5 in eclipse
Next Topic:Redirect standard output for a run ?
Goto Forum:
  


Current Time: Wed May 07 12:10:52 EDT 2025

Powered by FUDForum. Page generated in 0.05025 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top