ARTICLE AD BOX
This is a bug that has been presumably fixed in late 2025. Although it looks like the fix will only apply to event handlers and not all void methods.
Looks like it was included in VS too. Not sure which release of VS 2022 has the changes - can't be < 17.14.22. Latest is 17.14.25, so updating to it might fix your issue (haven't tested myself).
If you are using VS 2022 Pro/Enterprise, you can temporarily try to downgrade to 17.12.* (LTSC channel) suppored until July 2026. As mentioned in a comment I couldn't reproduce the bug in 17.12.3 - hopefully it didn't make its way in later patch versions.
7,6492 gold badges16 silver badges32 bronze badges
4 Comments
I found a temporary solution that can perfectly meet your needs. Just import an 'await' snippet and then it will only insert 'await' without changing any code. I use 'awa' as shortcut here to retain the original functionality.
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>await</Title> <Shortcut>awa</Shortcut> <Description>Code snippet for 'await' keyword</Description> <Author>Shingo</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Code Language="csharp"><![CDATA[await $end$]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>30.6k7 gold badges38 silver badges71 bronze badges
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 await in 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.
5,9151 gold badge26 silver badges39 bronze badges
4 Comments
Explore related questions
See similar questions with these tags.



