Reputation: 13
Starting from c# 10.0 came a new way of a namespace declaration, aka File-Scoped. For Visual Studio 2022 all look fine, but not for VSCode: See the old way of namespace declaration and the new one.
And it's not up to the selected theme.
Is it possible to get around this problem?
Upvotes: 1
Views: 5554
Reputation: 11301
I had the same issue recently. I think that OmniSharp is not up to date yet. To fix the issue, add these settings to the Settings JSON:
"editor.semanticHighlighting.enabled": true,
"csharp.semanticHighlighting.enabled": true,
That worked for me.
Upvotes: 7
Reputation: 17522
This works fine for me with VSCode 1.63 and C# extension version 1.23.17.
Make sure that both versions are up to date. It should auto update extensions and suggest updates for VSCode itself as default but it seems like it isn't updating properly for everyone (or at least not fast enough).
Upvotes: 1