Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse, How to activate Folding in XML file?

Tags:

I have problem with folding when I'm writing code in XML. Actually, when I'm writing Java code there is no problem and I can expand/collapse my codes.

However, in XML there is no folding icon although it is active. In side bar (line number), I right click then I select Folding > Enable Folding the width of bar becomes wider but I can't see folding icon. My background of screen is black is it possible this color covers folding icon? I don't think it because of this because when I click those area nothing happens.

like image 845
Hesam Avatar asked May 28 '12 09:05

Hesam


People also ask

How do I enable expand collapse in eclipse?

-ctrl + 0 = collapse all. -ctrl + 9 = exand all.

How do I indent an XML file in eclipse?

In Eclipse, you try to open Preferences, select XML, select XML Files and then select Editor to change the configuration of the indentation size when using space (Indent using spaces -> Indentation size). Sometimes, you will not be able to change the number in this box or press the + or – button.


1 Answers

Eclipse Mars (4.5.1)

  1. XML file having the .xml extension

    Just edit / open the file and the folding option will be available:

    enter image description here

    But if you disable and then enable the folding from right click on the left side bar:

    enter image description here

    there is a bug: folding won't be available.

    Workaround: change the tab to another file and then come again to the previous tab. The icons will be back.

    enter image description here

  2. XML file having a different extension (E.g.: .xaml)

    You can try to open the file using the XML Editor from the right click:

    enter image description here

    enter image description here

    and if it fails, just add the file extension to the XML (Illformed) from Window > Preferences > General > Content Types:

    enter image description here

    enter image description here

    enter image description here

like image 196
ROMANIA_engineer Avatar answered Oct 19 '22 15:10

ROMANIA_engineer