Omnisharp-vscode: Failing syntax highlighting when using `await foreach`

Created on 14 Mar 2020  路  4Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

C# Extension version:
ms-dotnettools.csharp: version 1.21.14

Steps to reproduce

The syntax highlighting is broken for await foreach usage.

Basically all code after the await foreach declaration becomes broken

eg this snippet

public class Foo {
  public override async Task waitTask(Brick.Grpc.StringMsg task, IServerStreamWriter<Bamse.Grpc.Any_Task_TaskEvent> streamWriter, ServerCallContext context) {
    var stream = Bamse.Session.Default.Hub.waitTask(task);
    await foreach (var e in stream.ResponseStream.ReadAllAsync()) {
      await streamWriter.WriteAsync(e);
    }
  }

  public override async Task<Brick.Grpc.Void> revokeTask(Brick.Grpc.StringMsg task, ServerCallContext context) {
    return await Bamse.Session.Default.Hub.revokeTaskAsync(task);
  }
}

Screenshot for reference:
Screenshot 2020-03-14 at 10 07 15

Resolved-External Triaged

Most helpful comment

Any idea when this will make it into release?

All 4 comments

this should be moved to dotnet/csharp-tmLanguage

This issue will be resolved once the semantic token api is introduced in the release build.

Any idea when this will make it into release?

@doodlefolks @koliyo this is now fixed - just turn on editor.semanticHighlighting.enabled

Was this page helpful?
0 / 5 - 0 ratings