I keep getting suggestions to turn serializable variables into readonly fields in vs code, and warnings about functions like Awake, and Update being unused because they aren't directly called anywhere inside the script

Hello, I’m starting a new project, so I switched to a newer unity version (from 2021 to 2022), but I’ve been running into a few issues with vscode since changing versions, at first intellisense wasn’t working at all despite working just fine on visual studio, but after remaking the project from scratch it seemed to fix itself, now I’m running into a new issue

When creating serializable variables they get underlined in blue, with a suggestion to make them read only, after reading a bit on the topic it seems this is because vscode doesn’t recognize that these variable’s values will get assigned inside of unity, and is just trying to incorrectly solve an issue that doesn’t exist. I’m aware that this is in no way fatal, however it’s still very inconvenient and annoying to have all these variables be flagged like this

Same thing happens with unused variables

And basic functions that aren’t directly called elsewhere like Awake, Start, and Update

I’ve never had this issue before despite using vscode and unity for a couple of years now. Was wondering if anyone knew a way to disable these warnings, or for vscode to correctly communicate with unity so the warning won’t pop up at all, thanks in advance!

Software details

  • Unity version: 2022.3.5f1 (LTS)
  • VS Code version: 1.80.2 (user setup)

TL;DR private, unused variables, and functions such as start and update get underlined in blue, vscode insists I turn these into readonly fields, or that they aren’t being used, I would like to get rid of these warnings

Check your C# and C# Dev Kit extensions are upgraded to the latest versions, and that you’ve restarted VS Code.
There are more resolutions on the forum page announcing the release.

While someone smarter than me can fill in the context here, it seems to be related to the 2.0.320 version of the C# extension “switching to the new Roslyn language server as the default”. There is a setting under Dotnet → Server called Use Omnisharp which, after enabling and restarting, removes the suggestions.