JetBrains Rider C# naming style for private methods and properties

落爺英雄遲暮 提交于 2019-12-22 22:19:50

问题


I'd like to make the first letter of private methods lowercase and the first letter of public methods uppercase. However, in Rider there seems to be only one option under C# naming style that applies all methods, properties and events. What is the best way to tell Rider to use a different convention for private only?

(see also: ReSharper C# naming style for private methods and properties, Resharper version of this question)


回答1:


Rider doesn't have UI for cutom naming rules yet, see see RIDER-8339. A possible workaround:

  1. Open the solution in Visual Studio with ReSharper
  2. Add a custom naming rule: ReSharper | Options | Code Editing | C# | Naming Style -> Advanced Settings
  3. Save settings to a team-shared layer
  4. Open/reopen solution in Rider


来源:https://stackoverflow.com/questions/48104681/jetbrains-rider-c-sharp-naming-style-for-private-methods-and-properties

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!