doxygen-vb-filter icon indicating copy to clipboard operation
doxygen-vb-filter copied to clipboard

bug on interface with enum

Open mattumotu opened this issue 7 years ago • 2 comments

The following vb.net code:

Public Interface ISample
    Inherits IDisposable

    ''' <summary>
    ''' simple property
    ''' </summary>
    ''' <value>returns a string value</value>
    Property StringProperty() As String

    Enum SampleEnum1 As Short
        Value1         ' first value
        ''' <summary>
        ''' second value
        ''' </summary>
        Value2
        Value3 = 1234  ' third assigned value
        Value4         ' fourth value
    End Enum

End Interface

correctly produces this c#:

	public interface ISample
	: IDisposable
	{
		/**
		 *  <summary>
		 *  simple property
		 *  </summary>
		 *  <value>returns a string value</value>
		 */
		string StringProperty  
		{ get; set; }
		enum SampleEnum1
		{
			Value1, /**< \brief  first value */
			/**
			 *  <summary>
			 *  second value
			 *  </summary>
			 */
			Value2,
			Value3 = 1234, /**< \brief  third assigned value */
			Value4 /**< \brief  fourth value */
		}
	}

However if you swap the enum and property order around: the following vb.net code:

Public Interface ISample
    Inherits IDisposable

    Enum SampleEnum1 As Short
        Value1         ' first value
        ''' <summary>
        ''' second value
        ''' </summary>
        Value2
        Value3 = 1234  ' third assigned value
        Value4         ' fourth value
    End Enum

    ''' <summary>
    ''' simple property
    ''' </summary>
    ''' <value>returns a string value</value>
    Property StringProperty() As String

End Interface

produces the following broken c#:

	public interface ISample
	enum SampleEnum1
	{
		Value1, /**< \brief  first value */
		/**
		 *  <summary>
		 *  second value
		 *  </summary>
		 */
		Value2,
		Value3 = 1234, /**< \brief  third assigned value */
		Value4 /**< \brief  fourth value */
	}
	: IDisposable
	{
		/**
		 *  <summary>
		 *  simple property
		 *  </summary>
		 *  <value>returns a string value</value>
		 */
		string StringProperty  
		{ get; set; }
	}

Notice the enum is declared in the middle of the interface declaration line, not in the body. This confuses doxygen mightily!

mattumotu avatar Jul 04 '17 13:07 mattumotu

This also seems to happen with enums on classes

mattumotu avatar Jul 05 '17 09:07 mattumotu

I know your comment is long time ago but I'm working on a fork for this script and already fixed this issue. Just let me know if you are still interested.

coding-pivo avatar Oct 30 '18 14:10 coding-pivo