Problems list broken when Roslyn Analyzer is enabled
See original GitHub issueProblems list is only showing issues from files just opened in editor if “Roslyn Analyzer” is enabled and “Analyze Open Documents Only” is disabled. This is true for Errors, Warnings and Infos (which are all not filtered in the problems list). Note: “Max Project File Count For Diagnostic Analysis” is set much higher than the actual file count and does not even show any effect when set to 0 or negative.
Steps to Reproduce
Settings:
"omnisharp.useModernNet": true,
"omnisharp.enableRoslynAnalyzers": true,
"csharp.maxProjectFileCountForDiagnosticAnalysis": 10000
Expected Behavior
All Errors, Warnings and Infos across all *.cs files in the workspace are listed under problems.
Actual Behavior
Any Errors, Warnings and Infos of one *.cs file are listed only once that file has been opened in editor. (Any errors in files not being opened are never being listed.)
Once "omnisharp.enableRoslynAnalyzers": false
is set - all errors are listed again as expected.
OmniSharp log
Starting OmniSharp server at 4/14/2022, 10:39:08 AM Target: d:\proj\xxx
OmniSharp server started with .NET 6.0.103 . Path: c:\Users\chr.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64.omnisharp\1.38.2-net6.0\OmniSharp.dll PID: 12388
Starting OmniSharp on Windows 10.0.19044.0 (x64)
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
Using the 'dotnet' on the PATH.
DotNetPath set to dotnet
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.103 17.0.0 - "C:\Program Files\dotnet\sdk\6.0.103\"
Registered MSBuild instance: .NET Core SDK 6.0.103 17.0.0 - "C:\Program Files\dotnet\sdk\6.0.103\"
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
Queue project update for ...
… info: OmniSharp.WorkspaceInitializer Configuration finished. info: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location ‘d:\proj\xxx’ on host 14932. info: OmniSharp.MSBuild.ProjectManager Loading project: … … info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers Solution initialized -> queue all documents for code analysis. Initial document count: 286.
Environment information
VSCode version: 1.66.2 C# Extension: 1.24.4
Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.103 Commit: 2d7bc7059fRuntime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.103\
Host (useful for support): Version: 6.0.3 Commit: c24d9a9c91
.NET SDKs installed: 1.1.4 [C:\Program Files\dotnet\sdk] 2.1.300 [C:\Program Files\dotnet\sdk] 2.1.805 [C:\Program Files\dotnet\sdk] 2.1.818 [C:\Program Files\dotnet\sdk] 3.1.405 [C:\Program Files\dotnet\sdk] 3.1.417 [C:\Program Files\dotnet\sdk] 5.0.212 [C:\Program Files\dotnet\sdk] 6.0.103 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
cpptools | ms-vscode | 1.9.7 |
csharp | ms-dotnettools | 1.24.4 |
data-workspace-vscode | ms-mssql | 0.1.1 |
gitlens | eamodio | 12.0.6 |
json-pretty-printer | euskadi31 | 1.1.0 |
jupyter | ms-toolsai | 2022.3.1000901801 |
jupyter-keymap | ms-toolsai | 1.0.0 |
jupyter-renderers | ms-toolsai | 1.0.6 |
live-html-previewer | hdg | 0.3.0 |
mssql | ms-mssql | 1.13.0 |
python | ms-python | 2022.4.1 |
sql-database-projects-vscode | ms-mssql | 0.14.1 |
swagger-viewer | Arjun | 3.1.2 |
vscode-arduino | vsciot-vscode | 0.4.11 |
vscode-commons | redhat | 0.0.6 |
vscode-docker | ms-azuretools | 1.21.0 |
vscode-postgresql | ms-ossdata | 0.3.0 |
vscode-pylance | ms-python | 2022.4.1 |
vscode-xml | redhat | 0.20.0 |
vscode-yaml | redhat | 1.6.0 |
xslt-xpath | deltaxml | 1.2.3 |
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:14 (6 by maintainers)
Top GitHub Comments
Since no feedback was given by an O# developer, I made a pull-request of the fix, which in my opinion, should be applied.
Hoping that this does not irritate anyone, I would have preferred to receive guidance before doing so.
I did a
git bisect
today after learning about this issue, and thanks to @rjgotten it was really quick to do. The culprit of this problem seems to be the commit 6c306e8888be4f53423d7f4d253777e53c661ee4, and restoring the only file it touches solves the issue, tested by building the latest stable version1.25.0