Skip to content

XmlDocCommentAttributeName classification type assigned to a leading whitespace trivia #48094

@NejcBW

Description

@NejcBW

Version Used: .NET 5 RC1, Microsoft.CodeAnalysis.CSharp.Workspaces version 3.7.0

Steps to Reproduce:

Debug the following code snippet and inspect the returned classifiedSpans object. Check for the classification type of the leading whitespace trivia of the XmlName identifier token (i.e. the space between "param" and "name" in the analysed string).

Couldn't get the code displayed correctly here, so I am attaching this snap (code borrowed and adapted from here:
snap

Expected Behavior: The leading whitespace should be of XmlDocCommentText type.

Actual Behavior: The returned type of the whitespace is of XmlDocCommentAttributeName type.

Implications: Omnisharp, for instance, defines semantic types sent to the client for highlighting based on the classification types returned by Roslyn. Hence, if we want to create a color theme that underlines XmlDocComment attribute name (such as for example in JetBrains Darcula theme), the the leading whitespace also gets underlined. Example of this can be seen here:

Screenshot 2020-09-26 195949

Metadata

Metadata

Assignees

No one assigned

    Labels

    4 - In ReviewA fix for the issue is submitted for review.Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactorings

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions