Open rjgotten opened 3 years ago
Almost makes me think that there's some internal threshold set at 1000 that's being exceeded.
@rjgotten You got it! You can adjust the setting csharp.maxProjectFileCountForDiagnosticAnalysis
as needed.
Wow. That definitely needs some more awareness then.
On the short term it would probably be a good idea to surface the existence of that option to users that hit this limit, I think. Maybe spawn an info or warning level issue in the Problems pane which tells the user that this option exists; what it's currently set to, and how many files the user is currently queuing for analysis? Or pop a notification in VS Code's notifications infrastructure.
On the long term: why does Omnisharp have to cap out like that? Can't it run background analysis in batches and then only keep the analysis problem results in memory (or even in a disk cache)? I understand that it would probably be too memory-intensive to keep the entire analysis in memory; but just keeping a cache of the detected problems shouldn't take that much, right?
Issue Description
I'm working in a sizeable C# solution reaching towards the thousands of classes spread over dozens of projects. Recently the VSCode Problems pane that would normally report problems (errors, warnings, info) in all
.cs
files that are part of the solution, started to only report issues for files that are actually open in the editor. Linked to this, files affected by errors or warnings also no longer color as red or yellow in the VSCode file navigator. Even something as explicit as a#warning
pragma is not reported back.Switching back to an older branch of the same project, issues start being listed again. No project settings were adjusted between these two branches. I compared to make sure of that. The only significant difference may be in the amount of files to be analyzed, as the solution in question recently had quite a bit of code added to it to facilitate new features.
The branch where things work as is to be expected, queues ~980 files for initial analysis. The branch where things break, queues ~1100 files for initial analysis.
Almost makes me think that there's some internal threshold set at 1000 that's being exceeded. Or that we're maybe pushing things passed a hard memory limit somwhere?
Steps to Reproduce
Open a solution that's sufficiently large and is known to have reportable issues.
Expected Behavior
Though performing the initial solution analysis on a big solution may be slower (and maybe have to execute in more batches) I expect the analysis to finish properly and report back all the issues to VSCode so it can populate the Problems pane; highlight affected files in the file navigator; etc.
Actual Behavior
Initial file analysis doesn't result in any issues reported back to the VSCode to populate the Problems pane; highlight the file navigator; etc. even though there definitely are.
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.55.0 C# Extension: 1.23.9
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.201 Commit: a09bd5c86c Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.201\ Host (useful for support): Version: 5.0.4 Commit: f27d337295 .NET SDKs installed: 2.1.505 [C:\Program Files\dotnet\sdk] 2.1.507 [C:\Program Files\dotnet\sdk] 2.1.508 [C:\Program Files\dotnet\sdk] 2.1.509 [C:\Program Files\dotnet\sdk] 2.2.107 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk] 5.0.201 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |alignment|annsk|0.3.0| |csharp|ms-dotnettools|1.23.9| |DocFX|ms-docfx|0.1.3| |material-icon-theme|PKief|4.6.0| |vetur|octref|0.33.1| |vscode-eslint|dbaeumer|2.1.19|;