dotnet/roslyn

Naming Style using underscore multiplies underscore

開放

#57,896 建立於 2021年11月20日

 (0 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-IDEBugDeveloper Communityhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] [regression] Hi, I prefer "snake case" for my parameter and private field style in C#, and in setting up VS 2022 to prefer it, there was some unexpected behavior.

  • in C# section of text editor options.
  • I added a Naming Style specifying the Word Separator as underscore "" and Required prefix also had an underscore "".
  • I had a constructor with a parameter that had an underscore in the name i.e. "my_parameter"
  • using the Quick Actions and Refactor menu, I clicked create and assign field.

I expected the field to be named _my_parameter

the field was named _my___parameter with 3 underscores

I expected the single underscore to remain in the field name.

the my_parameter example is contrived to type this report.

I will attach the actual screenshots to this report.

Thank You

Jason Welty

B3d4da6a0e67f442eafc582db76088541637728520658533749_snake_case_bug_1 (1)

Bbd384935b970424f9af05747d2f55fc7637728520728812121_snake_case_bug_2


Original Comments

Feedback Bot on 11/18/2021, 07:02 PM:

Feedback Bot on 11/19/2021, 09:41 AM:


Original Solutions

(no solutions)

貢獻者指南