dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.88k stars 4.01k forks source link

Refactoring tool: make function async #36737

Open vsfeedback opened 5 years ago

vsfeedback commented 5 years ago

VSF_TYPE_MARKDOWNIt would be great to have right click -> refactoring tools -> MAKE METHOD ASYNC. This would make the current function async, and update its callers to await and become async too, recursively. Functions with out and ref parameters would change their signature to have only 'in' parameters and return all values within a tuple.

This issue has been moved from https://developercommunity.visualstudio.com/content/idea/608719/refactoring-tool-make-function-async.html VSTS ticketId: 919128 These are the original issue comments:

Jane Wu [MSFT] on 6/17/2019, 01:29 AM (8 days ago):

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.

alrz commented 4 years ago

Looks like there's an implementation here: https://github.com/microsoft/vs-threading/blob/master/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs

@sharwell Could we possibly port it to roslyn? if not how we can use that (ideally as a VS extension - without installing a package)?