Visual Studio 2022 appears to have a feature which automatically adds the async keyword to the current method signature if you type the await keyword.
For example, if I have a partially-written method
public class C
{
public void M()
{
await//I'm still typing
}
}
Then after pressing the spacebar after the "t" in "await", the method automatically becomes async void:
public class C
{
public async void M()
{
await // I'm still typing, but I just completed the await keyword
}
}
In the editor's undo list, the automatic addition of the async keyword is listed as an undo step called "Completion". I have IntelliCode activated.
I dislike this feature because I don't wish to add async void methods to my codebase without careful consideration. What Visual Studio feature is causing this behaviour, and how can I turn it off?
My visual studio version is
Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.1.1