dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 670 forks source link

Control and unicode characters are not highlighted in the editor #5409

Open vctrro opened 1 year ago

vctrro commented 1 year ago

Environment data

dotnet --info output: .NET SDK (reflecting any global.json): Version: 6.0.402 Commit: 6862418796

Runtime Environment: OS Name: Mac OS X OS Version: 12.6 OS Platform: Darwin RID: osx.12-x64 Base Path: /usr/local/share/dotnet/sdk/6.0.402/

global.json file: Not found

Host: Version: 6.0.10 Architecture: x64 Commit: 5a400c212a

.NET SDKs installed: 3.1.422 [/usr/local/share/dotnet/sdk] 3.1.423 [/usr/local/share/dotnet/sdk] 3.1.424 [/usr/local/share/dotnet/sdk] 6.0.400 [/usr/local/share/dotnet/sdk] 6.0.401 [/usr/local/share/dotnet/sdk] 6.0.402 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.28 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.30 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.28 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.29 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.30 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

VS Code version: 1.72.2 C# Extension version: 1.25.0

OmniSharp log

Steps to reproduce

  1. Create dotnet project
  2. Insert control or unicode characters into a string. For example: Console.WriteLine($"\"Issue\"\nControl characters not highlighted in editor\\\n\u00A3");
  3. Change Color Theme

Expected behavior

A control or unicode characters should be highlighted in color.

Actual behavior

A control or unicode characters don't highlighted in color. After changing the theme, the highlighting appears and immediately disappears

Additional context

When this extension is disabled, everything works correctly. Tested for macos and windows.

dibarbet commented 1 year ago

@vctrro which theme are you changing to? Some themes don't have colors defined for all textmate scopes and so many not colorize all concepts similarly. We'd recommend the Visual Studio 2019 Dark theme.

vctrro commented 1 year ago

@dibarbet the bug reproduces on any theme