Skip to content

C# Syntax highligting in razor files incorrect for nullable properties #191

Closed
@tn-5

Description

@tn-5

When defining a nullable property in the @code block in a razor file the syntax highlighting does not work correctly.

Details copied from: https://github.com/dotnet/aspnetcore/issues/24791

Reproduce

  • Generate standard template project: dotnet new blazorserver
  • Open in VS Code
  • Open FetchData.razor
  • Observe syntax highlighting correctly highlights WeatherForecast as a class/type

Add nullable field

  • Add string? test; before the WeatherForecast declaration
  • Observe that the highlighting of WeatherForecast is still correct

Add nullable property

  • Add string? test1 {get; set;} before the WeatherForecast declaration
  • Observe that the highlighting of WeatherForecastnow reverts to generic text

It does not seem to make any difference if the setting on the project file is enabled or not.

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