dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 676 forks source link

Syntax highlighting broken under certain circumstances #5366

Closed ghost closed 1 week ago

ghost commented 2 years ago

Issue Description

If you declare { get; set; } as a nullable value type using [CascadingParameter]or [Inject] syntax highlighting for everything that comes beneath breaks. Also seems to happen for the construct private className? itemName { get; set; }.

Steps to Reproduce

Write [CascadingParameter(Name = "Test")] public string? test{ get; set; } above your variable declaration, using BlazorServer.

Expected Behavior

Highlight syntax as expected. working

Actual Behavior

Syntax highlighting shows some weird highlighting behaviour. broken

Logs

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.71.0 C# Extension: 1.25.0

Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.400 Commit: 7771abd614 Runtime Environment: OS Name: Windows OS Version: 10.0.22000 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.400\ global.json file: Not found Host: Version: 6.0.8 Architecture: x64 Commit: 55fb7ef977 .NET SDKs installed: 6.0.202 [C:\Program Files\dotnet\sdk] 6.0.301 [C:\Program Files\dotnet\sdk] 6.0.303 [C:\Program Files\dotnet\sdk] 6.0.400 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.25.0| |docomment|k--kato|0.1.31| |git-graph|mhutchie|1.30.0| |githistory|donjayamanne|0.6.19| |gitlens|eamodio|12.2.1| |indent-rainbow|oderwat|8.3.1| |markdown-all-in-one|yzhang|3.4.3| |material-icon-theme|PKief|4.20.0| |material-theme|zhuangtongfa|3.15.4| |mssql|ms-mssql|1.16.0| |powershell|ms-vscode|2022.8.5| |rainbow-csv|mechatroner|2.4.0| |vscode-edit-csv|janisdd|0.7.2| |xml|DotJoshJohnson|2.5.1|;
JoeRobich commented 1 week ago

The C# extension supports semantic highlighting as well as an improved textmate grammar.