I cannot reproduce the problem.
before tab
afer tab
I’m running
Microsoft Visual Studio Professional 2022
Version 17.11.5
C# Tools 4.11.0-3.24460.3+5649376e0e5f5db3743a94a62b073f2cce4be5d9
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
In a response to a related issue async/await Visual Studio autocomplete #68512 on github the functionality is mentioned:
We also just add ‘async’ automatically to the method if you try to complete out
awaitin your method body.
It does not mention any modification of the return type (or lack thereof). Note that the opener of the issue explicitly asks for a modification of the return type to Task, which is the undesired behavior that you observe.
However the issue is “closed as not planned”.
In this PR, the functionality was implemented including the modification of the return type.

