jiller / agentsmithplugin

Automatically exported from code.google.com/p/agentsmithplugin
0 stars 0 forks source link

Add formatting rules for xml elements #138

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Allow to specify formatting rules for xml elements.
Similar to Resharper formatting rules user would be able to add new
elements to the list on the AgentSmith configuration page. 
Options for each element would include the following check boxes:
- line break before
- line break after
- indent content
- align begin and end tags
- remove line break before
- remove line break after

This would allow to format comments as:
        /// <summary>
        ///     Some summary for the method that may be
        ///     multi-line with <br/>
        ///     line break.
        ///     <para>
        ///     And paragraph that may not be indented.
        ///     </para> 
        /// </summary>
        /// <param name="parent">
        ///     The parameter description
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///     If the required <c>parent</c> argument is <c>null</c>.
        /// </exception>

Or compressed style as described in issue 86 
http://code.google.com/p/agentsmithplugin/issues/detail?id=86

Current AgentSmith functionality does preserve formatting entered in the
example above but I think it would be very useful if it formatted the
comments if configured that way by the user.

Original issue reported on code.google.com by dfayerma@gmail.com on 21 Jul 2009 at 7:52

GoogleCodeExporter commented 8 years ago
Changed status to New pending approval from forever.zet

Original comment by dfayerma@gmail.com on 21 Jul 2009 at 7:56

GoogleCodeExporter commented 8 years ago
1. line break before/after,  remove break before/after:
Will these options affect root elements only, all elements or configurable 
elements?

So in your example,  I'd want to insert breaks after/before <summary> and 
<para>, 
after <br/> but I'd like to remove break after and before <c> 

2. indent content
Will this work this way?
<summary>
Paragraph One.
    Paragraph Two.
</summary>

->

<summary>
   Paragraph One.
       Paragraph Two.
</summary>

So bacically will it just shift entire contents of root elements only?

Shall we allow specifying number of tabs/spaces to indent?

3. Align tags
   How will be this case handled?
   <a>asdfsdf</a>

   I think this shall relate only to tags found in the beginning of a line.

Original comment by forever....@gmail.com on 22 Jul 2009 at 10:24

GoogleCodeExporter commented 8 years ago
1. line break before/after,  remove break before/after:
>Will these options affect root elements only, all elements or configurable 
elements?

I think these options would affect configurable elements. Allow to configure 
separate sets of options for each element.

2. indent content
>Will this work this way?
   <summary>
   Paragraph One.
       Paragraph Two.
   </summary>

->

<summary>
   Paragraph One.
       Paragraph Two.
</summary>

>So bacically will it just shift entire contents of root elements only?
Yes.

>Shall we allow specifying number of tabs/spaces to indent?
Good point. This shoudl be configurable.

3. Align tags
   How will be this case handled?
   <a>asdfsdf</a>

   >I think this shall relate only to tags found in the beginning of a line.
   I Agree, maybe this option should only be enabled if line break before and after 
the element is selected.

Original comment by dfayerma@gmail.com on 22 Jul 2009 at 1:37

GoogleCodeExporter commented 8 years ago
I seem to recall reading that ReSharper 5 will have some support for formatting 
of
XML.  I agree though that this is sorely needed, especially since doing more 
WPF work
in the last 6 months.

Original comment by drewnoakes on 26 Oct 2009 at 1:01

GoogleCodeExporter commented 8 years ago
V1.5 beta 4 can do some (all?) of this now - give it a go and let us know if 
more options are required, it does the wrong thing etc.

Original comment by cds...@gmail.com on 15 Jan 2012 at 12:48