Bug 243088 - [formatting] formatter inserting newline after comments should be optional
Summary: [formatting] formatter inserting newline after comments should be optional
Status: NEW
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 enhancement with 2 votes (vote)
Target Milestone: Future   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-08-04 15:23 EDT by Fabrizio Giustina CLA
Modified: 2013-06-19 11:14 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 Fabrizio Giustina CLA 2008-08-04 15:23:32 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Create an xml file with this content:

<test>
  <e><!--  --></e>
</test>

2. open with the xml editor and format it...

3. the result is:

<test>
  <e><!--  -->
  </e>
</test>

... while the expected result is to have the document unchanged. Apart from the fact that this kind of formatting is pretty ugly, it's different from what you get with the previous versions of eclipse/wtp (where the doc is formatted as expected).
I could'nt find any setting for this behaviour, nor any workaround to keep the previous formatting style, it's very annoying when working on a project where you are required to keep a consistent formatting between developers...


More information:
Comment 1 David Carver CLA 2008-12-25 16:11:43 EST
This looks like this is expected behavior in the current formatter.  As there is an existing comment in there.  I do agree though from a person that uses XML everyday, having the comment not break onto a seperate line is kind of ugly, and not typically what other XML editors do.

There should be a toggle that allows for selection of how to handle these types of elements.  I would expect to see the following when it formats:

<test>
  <e>
     <!--  -->
  </e>
</test>

Or

<test>
  <e>
     <!--

     -->
  </e>
</test>