Skip to content

C# syntax highlighting: as keyword followed by null-coalescing operator #245

@pyrrho

Description

@pyrrho

Details

Visual Studio Code 1.69.2
The problem has been observed in multiple themes, including Monokai.

Repro

Chaining the as keyword and the null-coalescing operator in a single line breaks tokenizing on following lines. For example;

var a = b as float[] ?? new float[];

Note the last of the three examples, how the for is green instead of red, and var C3 is white.
image

Inspecting the token scope shows that var C2 and var C3 are being parsed differently.
image
image

It's worth noting that I do have ms-dotnettools.csharp version 1.25.0 installed. The above screenshots were taken with the extension disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions