Bug 25550 - [typing] add support to split end of line comment
Summary: [typing] add support to split end of line comment
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-30 12:25 EST by Matthew Conway CLA
Modified: 2008-04-15 03:29 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 Matthew Conway CLA 2002-10-30 12:25:34 EST
It would be nice if running a Format on a buffer would break up long comments
into multiple lines to respect the max line length set for the Java->Code
Formatter.  This should preserve the "type" of comment (// Vs /**/).

Also, if one has a really long single line (//) comment and hits enter somewhere
in the middle, the new line should be automatically have a // at the beginning.

Likewise, since you have smart string wrapping in M2, the Format of a buffer
should wrap long strings if that preference is enabled.
Comment 1 Claude Knaus CLA 2002-10-31 05:39:22 EST
Requires some thought on how to combine java core formatting (java language) 
together with comment formatting (localized).
Comment 2 Kai-Uwe Maetzel CLA 2002-11-18 12:17:58 EST
As formatting is based on content types, we would have a way to distinguish 
code from comment formatting.
Comment 3 Mike Wilson CLA 2008-04-13 14:39:07 EDT
Most of this has been implemented already:
- code formatting causes long comment lines to wrap appropriately
- hitting return in the middle of a /* */ comment causes the new line to start with "*"

The only other interesting thing to potentially address would be adding the "//" characters when a "//" comment is broken into multiple lines.

Leaving open for review by JDT Text team. If the "//" comment splitting is not going to be addressed, please close the bug.

Comment 4 Dani Megert CLA 2008-04-14 09:01:39 EDT
>The only other interesting thing to potentially address would be adding the
>"//" characters when a "//" comment is broken into multiple lines.
Guess that would make sense to implement. But when I have
// Here is my comment
and press Enter at the end, then we would not start a new line.
Comment 5 Mike Wilson CLA 2008-04-14 12:37:45 EDT
Not sure I parsed what you wrote correctly, but definitely hitting return at the end should not add the "//". Only when splitting an existing comment in the middle.
Comment 6 Dani Megert CLA 2008-04-15 03:29:57 EDT
You parsed well ;-)