Arnold Zahrneinder
Arnold Zahrneinder

Reputation: 5200

VS Code IntelliSense fails on C# 9.0

It's been a quite a while that C# 9 has been around and now I just noticed that SDK 5 has officially been released. For that reason I switched to C# 9 and .Net 5 but 'ms-dotnettools.csharp' which is the official VS Code extension for C# unfortunately does not have syntax highlighting and appropriate IntelliSense support for C# 9. For example it doesn't highlight record types, or when I use Top-Level Statements, it confuses that with a compile time error. However, the project always compiles.

Is there any workaround to fix these and enjoy the amazing C# 9.0 when coding in VS Code?

Upvotes: 10

Views: 1849

Answers (2)

RevrenLove
RevrenLove

Reputation: 558

This has been addressed with the latest release of the C# extension (v1.23.9). In order to enable, add the following to your settings.json:

"editor.semanticHighlighting.enabled": true,
"csharp.semanticHighlighting.enabled": true,

Relevant Issue | Relevant Pull Request

Upvotes: 14

mehrdad mohajjel
mehrdad mohajjel

Reputation: 1

I use ReSharper instead in this problem

Upvotes: -8

Related Questions