Bug 419336 - Formatter inserts carriage return without newline character
Summary: Formatter inserts carriage return without newline character
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.xml CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2013-10-14 04:14 EDT by Zsolt Bertalan CLA
Modified: 2013-10-14 11:06 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 Zsolt Bertalan CLA 2013-10-14 04:14:43 EDT
Java Code Style Formatter inserts carriage return without newline character in XML files after commented out code. This happens only when I switch to UTF8 in General -> Workspace -> Text file encoding.
After this happens Eclipse is confused and edits text on the line above I'm editing.
Comment 1 Dani Megert CLA 2013-10-14 04:25:27 EDT
> Java Code Style Formatter inserts carriage return without newline character in > XML files 

The Java formatter does not format XML (files). Can you give exact steps that reproduce the problem?
Comment 2 Zsolt Bertalan CLA 2013-10-14 06:24:38 EDT
Then this is maybe related to Android ADT plugin. Sorry and please close the report if that's the case. I forgot to mention that I use ADT plugin (22.2.1).
Steps to reproduce:
1. Open any Layout XML files with commented out parts.
2. Press CTRL + SHIFT + F (Formatter)

The error will arise at the last line of the commented out part.
Comment 3 Dani Megert CLA 2013-10-14 08:35:40 EDT
(In reply to Zsolt Bertalan from comment #2)
> Then this is maybe related to Android ADT plugin. Sorry and please close the
> report if that's the case. I forgot to mention that I use ADT plugin
> (22.2.1).
> Steps to reproduce:
> 1. Open any Layout XML files with commented out parts.
> 2. Press CTRL + SHIFT + F (Formatter)
> 
> The error will arise at the last line of the commented out part.

If you format an XML file then it might be WTP that causes the bug.
Comment 4 Zsolt Bertalan CLA 2013-10-14 09:02:04 EDT
I don't use WTP. I use Android ADT.
Comment 5 Dani Megert CLA 2013-10-14 09:06:28 EDT
(In reply to Zsolt Bertalan from comment #4)
> I don't use WTP. I use Android ADT.

The question is, into which package you installed ADT. Take a look at the About dialog to check whether WTP is also installed.
Comment 6 Zsolt Bertalan CLA 2013-10-14 09:32:27 EDT
I used the Standard Eclipse platform and installed ADT on top of it. JDT and CDT are installed. I don't know why I need CDT. Ah, probably for the Android NDK (which I don't use).
Comment 7 Dani Megert CLA 2013-10-14 10:50:42 EDT
OK, since you don't have WTP installed the Format action comes from ADT. Please report the bug there.
Comment 8 Nitin Dahyabhai CLA 2013-10-14 11:06:17 EDT
ADT does make use of the XML features from WTP, but its layout editor definitely uses its own formatter by default.