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.
Summary: | XML editor reformat feature should break up one big line XML into multiple lines | ||
---|---|---|---|
Product: | xml | Reporter: | J Xu <junxu> |
Component: | Code | Assignee: | issues@xml <issues> |
Status: | REOPENED --- | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
J Xu
2007-01-11 03:06:05 UTC
The auto-format feature is already there: do right click context menu command 'Reformat Code', consistent with java editor. I didn't see the menu item there, but Ctrl-Shift-F does do the auto-indent. The problem is that it only works when an XML already has CRLFs in it. If the XML is just one big line, it does not "beautify" the XML. The menu is shown when you right click on the xml source text. Yes, the big line is not broken up by the reformat. It behave the same way as java editor. I don't know why, but yes, I agree that it is desirable that the reformat would break down big line too. Maybe you need to change the issue summary line just not to confuse future evaluator. To make it symmetry, we may also want to have a feature that strips off all whitespaces from an XML and make it one big line. This reverse formatting feature might be useful to create XML documents for testing purpose. Changed summary line. I've looked over the issues which relate to autoformatting of XML and have found this issue as most general. So I suggest to consider the following issues as dependant: #89769, #93642, #82517, #97513. I think a kind of configuration settings are required to the user will be able to specify a desired autoformat rules. They could be following: -- Split the lines which are longer then a specified maximum length; -- Put specific kinds of lines like prefixes of import declarations to separate lines; -- Remove redundant spaces; and so on. Also a part of such rules can be applied automatically for an inserted part of XML. It seems such a feature in called "autoindent" in the Java editor. It could be helpful when a new import is added to the XML file. The issue #97513 requires that a new prefix declaration appeares on separate line. But it's undesirable ot autoformatting the whole XML document in such case. *** Issue 97513 has been marked as a duplicate of this issue. *** I raised priority as it causing productivity loss. This issue is particularly vexing in the JSP tab of the visual JSF editor. The lines get v e r y v e r y long, and it takes an inordinate amount of horizontal scrolling to edit them. Please fix this! |