Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 634
Arnold Zahrneinder Avatar asked Nov 22 '20 11:11

Arnold Zahrneinder


People also ask

Why C is not working in VS Code?

Go to the menu Code > Preferences > Settings. In the User tab on the left panel, expand the Extensions section. Find and select Run Code Configuration. Find and check the box Run in Terminal.

Why is VS Code not working IntelliSense?

Troubleshooting. If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.

Why is IntelliSense not working Visual Studio 2022?

Please try: Go to Visual Studio Installer, click Modify , uncheck IntelliCode in Individual components, then click Modify button to save the change, wait for the installation to complete, and then reinstall IntelliCode . In Visual Studio, go to Tools->Options->IntelliCode to check if the setting is Default.


1 Answers

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

like image 184
J From The Sticks Avatar answered Sep 20 '22 17:09

J From The Sticks