dotnet/roslyn

[Request] Use SymbolDisplayFormat to display modifiers and accessibility for a class, struct, interface and delegate

オープン

#28,297 opened on 2018/07/05

 (0 件のコメント) (2 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-CompilersConcept-APIFeature Requesthelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

I would like to display class symbol similar how it is displayed on docs.microsoft.com.

For example if I have public static generic class with a constraint I would like to get:

public static class Foo<T> where T : Bar

But with current SymbolDisplayFormat I can get only:

class Foo<T> where T : Bar

There are options:

  • SymbolDisplayMemberOptions.IncludeModifiers
  • SymbolDisplayMemberOptions.IncludeAccessibility

but they are not applicable for a type declaration.

So I would propose to add a new options such as:

[Flags]
public enum SymbolDisplayTypeDeclarationOptions
{
  None = 0,
  IncludeModifiers = 1,
  IncludeAccessibility = 2
}

or extend SymbolDisplayMiscellaneousOptions.

コントリビューターガイド