How do I get a warning in Visual Studio when async methods don't end in 'Async'?

前端 未结 2 712
闹比i
闹比i 2021-01-30 02:20

How can I get Visual Studio to give me a naming warning each time I create an asynchronous method that doesn\'t end in \"Async\"?

It\'s the recommended convention for as

2条回答
  •  清歌不尽
    2021-01-30 03:00

    From Options,

    • Go to Text EditorBasicCode Style → Naming
    • Select Manage Specifications and Add New Specification
    • Select Method, tick all accessibility options and from Modifiers, select Async.
    • Give the title as Async Method and save
    • Now get into Manage Naming Styles and add New Style. Add Async as suffix and give it a name as AsyncSuffix, and then save
    • Now press the plus sign and create new naming. Select specification as Async Method, select required Style as AsyncPostfix and Severity as Suggestor.
    • Click OK and save

提交回复
热议问题