SymbolDisplay: Show underlying non-default type for enums#52603
SymbolDisplay: Show underlying non-default type for enums#52603CyrusNajmabadi merged 10 commits intodotnet:mainfrom
Conversation
| SymbolDisplayPartKind.Keyword, | ||
| SymbolDisplayPartKind.Space, | ||
| SymbolDisplayPartKind.EnumName); | ||
| } |
There was a problem hiding this comment.
so this should only be shown in the case where we're checking on the top level type. if the enum is referenced anywhere (like in a method signature) it woudl not be shown there. Can you write tests showing that that's the case.
Also, we'd likely need this for VB.
There was a problem hiding this comment.
so this should only be shown in the case where we're checking on the top level type
Yes. Adding the underlying type unconditionaly breaks all kinds of features (CI build failures confirm this). I haven't found an obvious way to prevent this. I think we need a new formatOption. But which one and where exactly should it go?
If such an option is present I could turn it of before any VisitNamedType calls e.g. if the SymbolDisplay is requested for an EnumMember.
Can you please give me some hints about what exactly you would expect here to solve this?
There was a problem hiding this comment.
Yes. Adding the underlying type unconditionaly breaks all kinds of features
I think we should only doing this in the codepth that is also adding enum. So we only would show: enum E : byte not E : byte just because E was used in a reference location. The SymbolDisplay code should already be partitioned to support this concept afaict.
|
@CyrusNajmabadi Ready for review. I started from scratch and moved away from |
|
That works for me. |
|
LGTM. Thanks! |
Fixes #52490