PrismJS / prism

Lightweight, robust, elegant syntax highlighting.

Home Page:https://prismjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[CSharp] Attributes following comments are either mis-tagged or not tagged as `class-name`

Nintynuts opened this issue · comments

Information

  • Language: C# (csharp)
  • Plugins: prism-csharp.js

Description
Attributes are only correctly identified when not immediately following a comment.

Code snippet

Test page

The code being highlighted incorrectly.
class MyClass
{
  /// <summary>
  /// This is a doc comment
  /// </summary>
  [Attribute]
  public string MyString { get; set; }
  
  /// <summary>
  /// This is a doc comment
  /// </summary>
  [Attribute(argument)]
  public string MyString { get; set; }
  
  // This is a normal comment
  [Attribute]
  public string MyString { get; set; }
  
  // This is without a comment:
  
  [Attribute]
  public string MyString { get; set; }
  
  [Attribute(argument)]
  public string MyString { get; set; }
}