Resolving the DocumentComment of a method with attributes

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 5 months ago by Rory Mathers
Version: 22.1.1
Platform: .NET 4.7
Environment: Windows 10 (64-bit)
Avatar

Hi,

We are trying to get the summary comment of a method, and have found that when an attribute is placed before the summary comment, the parser is unable to resolve the comments for the rest of the document.

public class MyTestClass
{  
  /// <summary>
  /// This comment is correctly resolved
  /// </summary>
  [Export]
  public static void TestMethod1()
  {
  }
  
  [Export]
  /// <summary>
  /// This comment is attributed to TestMethod3. No summary is found for TestMethod2.
  /// </summary>
  public static void TestMethod2()
  {
  }
  
  /// <summary>
  /// This comment is attributed to TestMethod4
  /// </summary>
  [Export]
  public static void TestMethod3()
  {
  }
  
  /// <summary>
  /// This comment is not attributed to any method
  /// </summary>
  [Export]
  public static void TestMethod4()
  {
  }
}

Is there anyway to fix this?

Kind Regards, Rory Mathers

Comments (2)

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rory,

Just to verify, are you seeing this when you paste the class above in a SyntaxEditor document such as in our main SyntaxEditor demo and then show the completion for the methods and examine their description tips?

When I do that, I see:

  • TestMethod1 show its doc comment correctly.
  • TestMethod2 not show any doc comment, which is also correct and VS does the same.
  • TestMethod3 shows the doc comment for TestMethod2, which is incorrect.
  • TestMethod4 shows its doc comment correctly, which is not the result you indicated.

Summarizing the above findings from our tests, the only problem I'm seeing is that the method right under the method with a misplaced doc comment is getting the wrong doc comment, but it's fine again after that.

We were able to make a code change that should resolve this issue and that change will roll into the next maintenance release.


Actipro Software Support

Posted 5 months ago by Rory Mathers
Avatar

Hi,

Thanks for the quick response, and yes you are correct. I had an extra attribute abow the Method 3 doc comment. When I remove it I get the same behaviour you described.

Kind Regards, Rory Mathers

The latest build of this product (v22.1.3) was released 27 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.