This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 135218 - Code Folds in XML files only work after formatting.
Summary: Code Folds in XML files only work after formatting.
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-16 14:17 UTC by bbrn
Modified: 2008-12-08 10:19 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bbrn 2008-05-16 14:17:50 UTC
Starting with NB 6.1, within an XML file the folding of XML elements only seems to work, if the file has been run
through the formatter.
Otherwise, only the top level element can be collapsed or expanded.
Comment 1 Samaresh Panda 2008-05-24 05:36:52 UTC
Do you have an example? If yes, please attach.
Comment 2 Samaresh Panda 2008-05-30 20:55:14 UTC
Can you pl. provide an example?
Comment 3 bbrn 2008-06-09 12:39:21 UTC
Providing an example is difficult, because it works most of the time.

As it looks, the problem seems not to be caused by formatting directly, but by something else.
I copied my original files to some other directory to simplify them a bit and suddenly they worked.
Nevertheless, they didn't work at their original location. 

But even there the folding markers came back after after inserting some whitespace after the XML header.
They even stayed there after reverting to the original file content.

The effect is reproducible, however. If I close the file and reopen it, folding markers are gone and won't come back
before doing some editing. 

In principle, I could live with that. What's really annoying is that folding also stops working again after doing some
further editing. I cannot say what exactly causes this, but in that case, I only got folding to work again after
reformatting, which brought me to the initial assumption that it is connected to formatting.

Comment 4 Samaresh Panda 2008-06-23 22:10:47 UTC
I understand that it didn't work sometimes and I want to fix that, however, if I do not have an example xml which fails,
I cannot really do anything. CC'ing Tony and Michael to try as well. For now, I'm downgrading. Please make it a P3 or P2
when you have an example.
Comment 5 bbrn 2008-06-24 11:42:12 UTC
I'm sorry that I can't come up with a reasonable example.
The problem doesn't seem to be related to a certain XML content.

The only things that I was able to reproduce were the following: 
- Folds sometimes don't show after loading a file. 
  Strangely this seems to depend on the file location on disc.
- Folds disappear after manually editing the file.
  Not all kinds of editing cause this effect. 
  I still couldn't find out what is exactly necessary to reproduce it.
- Folds reliably come back after autoformatting the file, but only, 
  if the XML validates successfully. 
Comment 6 Samaresh Panda 2008-06-24 17:08:50 UTC
How about you attach the files that you have had problems with, ever?
Comment 7 Samaresh Panda 2008-12-04 22:40:45 UTC
There used to be some issues with folds, which were fixed in 6.5. Please verify again.
Comment 8 bbrn 2008-12-08 10:19:01 UTC
XML Code folds seem to work fine with NB 6.5