jiller / agentsmithplugin

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

Insertion of unwanted tags #182

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Agent Smith inserts tags it shouldn't, sometimes only after multiple reformats.

Example:
Reformatting this:

/// <returns> 0 in case everything is ok, -1 otherwise. </returns>

yields this:

/// <returns>
/// <list type="number">
/// <item><description>in case everything is ok, -1 
otherwise.</description></item>
/// </list>
/// </returns>

It seems to convert to leading 0 in the comment to a numbered list item...

Reformatting this:

    /// <summary>
    ///   The Fluent NHibernate auto-mapping override class for the <see cref="BookingCostCenter" /> entity.
    /// </summary>

yields this (note the new langword tag):

    /// <summary>
    /// The Fluent NHibernate auto-mapping <see langword="override"/> class for the <see cref="BookingCostCenter" />
    /// entity.
    /// </summary>

reformatting again yields this (note the extra space at the end of the 
previously inserted tag and the inserted para tags):

    /// <summary>
    /// <para>
    /// The Fluent NHibernate auto-mapping <see langword="override" /> class for the <see cref="BookingCostCenter" />
    /// </para>
    /// <para>entity.</para>
    /// </summary>

Settings:
Max characters per line: 120
Place tags on new line: "Long lines only" for all tags.

Original issue reported on code.google.com by DHilgart...@gmail.com on 27 Jan 2012 at 1:01

GoogleCodeExporter commented 8 years ago
Re the first - this was due to the list detection code getting a bit carried 
away. I'll include some changes in the next beta to only start lists if it sees 
"<number>. " or "<number> - " at the start of a line.

Re the second, adding the langword tag is intended behavior. You could add a 
regex in the options to ignore that identifier if you don't want that behavior.

Re the last, I'll look into it - probably something to do with ending the 
previous line with a tag.

Original comment by cds...@gmail.com on 28 Jan 2012 at 12:27

GoogleCodeExporter commented 8 years ago

Original comment by cds...@gmail.com on 28 Jan 2012 at 12:27

GoogleCodeExporter commented 8 years ago
Re the first: "<number>) " would also be a good candidate. Maybe make in 
configurable.
Re the second: It looks like it is not working correctly anyway. Because a lot 
of other similar words don't get replaced, like "this" or "object".
Re the third: Yes, I think the tag at the end of the line seems to be the 
problem. If there is no tag at the end of the line this doesn't happen.

Original comment by DHilgart...@gmail.com on 28 Jan 2012 at 12:45