Bug 415480 - Outline view for XML should show portion of comment
Summary: Outline view for XML should show portion of comment
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.14   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2013-08-20 09:12 EDT by Matthew Harrah CLA
Modified: 2019-04-27 17:14 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot of exactly what I'm talking about (7.87 KB, image/png)
2013-08-20 09:12 EDT, Matthew Harrah CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Harrah CLA 2013-08-20 09:12:53 EDT
Created attachment 234578 [details]
Screenshot of exactly what I'm talking about

When editing an XML file, the outline view shows comments as a line with a green !-- icon, and the word #comment.  It would be more useful if instead of - or in addition to - the comment word, it showed the first few words of the comment itself (with line breaks removed). This text currently shows up in the tooltip, but would be more useful as the text of the outline row itself. This would allow you to place marker comments in your XML, and be able to see them in the outline view with a quick visual scan.
Comment 1 Nitin Dahyabhai CLA 2016-09-26 15:50:07 EDT
How many is the ideal "first few"?
Comment 2 Matthew Harrah CLA 2016-09-26 16:15:07 EDT
How about this: Show from the first non-white space character after the <!-- to the first line break after that, or the --> terminator

Example:
<!-- This is text-->

And

<!-- This is text
-->

And

<!--
  This is text
-->

And

<!-- This is text
This is a second line of text
-->

All would show "This is text"
Comment 3 Björn Michael CLA 2016-10-26 01:24:30 EDT
(In reply to Matthew Harrah from comment #2)
> How about this: Show from the first non-white space character after the <!--
> to the first line break after that, or the --> terminator
[...]
> 
> All would show "This is text"

That's a very good starting point which suffices the majority of use cases.
Was something already done regarding this issue?
Comment 4 Björn Michael CLA 2016-12-13 14:54:57 EST
The outline of Maven POM editor has this feature already and behaves like Matthew's description.
Comment 5 Nitin Dahyabhai CLA 2019-04-27 17:14:20 EDT
And now implemented in the general XML, HTML, and JSP Editors, plus with a few caveats, filterable in their quick outlines.