12

Can we have code highlighting for async and await in C#?

async and await was released with .NET Framework 4.5.

Visual Studio 2012 introduces a simplified approach, async programming, that leverages asynchronous support in the .NET Framework 4.5 and the Windows Runtime. The compiler does the difficult work that the developer used to do, and your application retains a logical structure that resembles synchronous code. As a result, you get all the advantages of asynchronous programming with a fraction of the effort.

async and await will not be recognised by the highlighter as you can see here:

public async void Foo()
{
    await Task.Delay(10000);
}
5
  • To be clear: are you saying the language highlighter doesn't recognise async or await for C#? Jul 28, 2015 at 8:19
  • 2
    @JonClements Yes, I updated my post Jul 28, 2015 at 8:23
  • 12
    I guess that's a feature-request on google prettify, nothing SE can do about it... Jul 28, 2015 at 8:31
  • 3
    @Deduplicator thank you, I found an already existing issiue on Github Jul 28, 2015 at 8:40
  • If it is not something SE can change because it is how third party implemented that feature, then I believe this is status-bydesign.
    – Travis J
    Jul 28, 2015 at 21:51

0

Browse other questions tagged .