-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax highlighting/colors for records does not work. #4211
Comments
you should enable semantic highlighting
|
@erichiller Sematntic classification for Records was added for Roslyn 3.9.0-2 but we are still on 3.8.0. Once we move OmniSharp-Roslyn to a suitable Roslyn, we can add a new classification for Records. Thanks for logging. We will use this issue to track adding this. |
Oh really? I would have sworn it worked, sorry for the confusion 🤔 |
@JoeRobich Is there something that blocks updating from 3.8.0 to 3.9.0-2 or higher? |
Looks like it was already updated in OmniSharp/omnisharp-roslyn#2022 |
I still experience this issue with the extension version 1.23.8. When I want to inspect editor scopes O# logs the following error: { |
Any updates on this ? I have same issue. |
this was already merged into OmniSharp and released 3 days ago https://github.com/OmniSharp/omnisharp-roslyn/releases it will be consumed in the next release of the C# extension for VS Code cc: @JoeRobich |
This one seems to have been fixed for a while (early february) so this could be closed now right? |
yes, thanks |
@filipw this should be reopened, unless this is how it is supposed to look (v1.23.11) |
do you have semantic highlighting enabled? if so, and it still happens, then please open a new bug with the file that reproduces this - there could be some specific positioning/alignment of symbols that results in this behavior. |
@filipw Thanks, enabling that works; but shouldnt this be considered a bug if omnisharp on default settings doesnt highlight a standard C# record? |
this is up to @JoeRobich to judge 🙂 Also, it's not an OmniSharp issue really - the OmniSharp server only provides semantic highlighting, the "regular" highlighting is based on static textmate grammar which is part of VS Code itself and is maintained here https://github.com/dotnet/csharp-tmLanguage |
Opened dotnet/csharp-tmLanguage#202 |
Issue Description
Syntax highlighting/colors for records does not work.
Steps to Reproduce
Create a dotnet 5 project. create a record, such as the below, I have included several positions/orders of
record
s in the code, as well as oneclass
for comparisonExpected Behavior
Coloration for
record
much like forclass
orstruct
, etc..Actual Behavior
The output depends on the order, see how
FooRecord3
moves and changes the output color.vs.
vs.
The presence of
{ }
curly braces seems to be the cause of the change. However, even with a curly braced record placed at the top, the highlighting is still inconsistent. Notice howpublic
is colored in therecord
definition ofFooRecord3
but not in the constructor as inFooClass
nor is the keywordrecord
displayed consistently in the 3record
s included.For a quick reproduction, here is the sample source
Note after pasting the source into this ticket, I notice that GitHub has syntax coloring issues as well with
record
s.OmniSharp log
C# log
none
Environment information
VSCode version: 1.51.1
C# Extension: 1.23.6
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.100 Commit: 5044b93829Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100\
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
3.1.102 [C:\Program Files\dotnet\sdk]
3.1.302 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
5.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: