dotnet / vscode-csharp

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

No syntax coloration #4910

Open sylvain-guillet opened 2 years ago

sylvain-guillet commented 2 years ago

4909 # Issue Description

No syntax coloration

Steps to Reproduce

Just create a class named class1 add method with some information I tried to uninstall and reinstall your extension but the bug is the same

Expected Behavior

class header "public class class1" public and class must be blue and class1 must be green if I add 'double a= 0.0; ' in a method, I expect to have at least double in blue

Actual Behavior

public class class1 is all green double a= 0.0; is all white

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.62.3 C# Extension: 1.23.16

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff Runtime Environment: OS Name: debian OS Version: 11 OS Platform: Linux RID: debian.11-x64 Base Path: /usr/share/dotnet/sdk/6.0.100/ Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa .NET SDKs installed: 6.0.100 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |better-cpp-syntax|jeff-hykin|1.15.10| |blazorwasm-companion|ms-dotnettools|1.1.0| |cmake|twxs|0.0.17| |cmake-tools|ms-vscode|1.9.1| |cpptools|ms-vscode|1.7.1| |cpptools-themes|ms-vscode|1.0.0| |csharp|ms-dotnettools|1.23.16| |csharp-colors|logerfo|0.1.8| |doxdocgen|cschlosser|1.3.2| |remote-containers|ms-vscode-remote|0.205.2| |test-adapter-converter|ms-vscode|0.1.4| |vs-keybindings|ms-vscode|0.2.1| |vscode-catch2-test-adapter|matepek|4.0.7| |vscode-docker|ms-azuretools|1.18.0| |vscode-dotnet-runtime|ms-dotnettools|1.5.0| |vscode-drawio|hediet|1.6.3| |vscode-pull-request-github|GitHub|0.32.0|;
taurisjoe commented 2 years ago

I noticed you're using .NET 6. I've seen this issue when omitting the namespace tag or using the new one line namespace My.New.Namespace; rather than the old style namespace My.New.Namespace { public class Foo ...}

JoeRobich commented 2 years ago

@sylvain-guillet Can you please share a complete sample of the code you are using?

Also, if you have not enabled semantic highlighting, you can try this experimental feature by enabling, "csharp.semanticHighlighting.enabled" in your settings.

sylvain-guillet commented 2 years ago

@JoeRobich the problem seems to become from one line namespace. namespace Application; public class Class1 { public Class1() { double a = 0.0; } }

JoeRobich commented 2 years ago

@sylvain-guillet Thanks for reporting. This issue is resolved in the current VS Code insiders build or by turning on semantic highlighting as mentioned above.