you need to mess a bit with Custom Analyzers to make it work fully, you need to download the nupkg file of Microsoft.Unity.Analyzers, open it with 7zip or winrar as a zip, and navigate to -> analyzers/dotnet/cs/ and add to Omnisharp as a custom analyzer the Dll that is in there. This should fix the problem, it did for me
you need to mess a bit with Custom Analyzers to make it work fully, you need to download the nupkg file of Microsoft.Unity.Analyzers, open it with 7zip or winrar as a zip, and navigate to -> analyzers/dotnet/cs/ and add to Omnisharp as a custom analyzer the Dll that is in there. This should fix the problem, it did for me