Open beccamc opened 10 months ago
I might be impacted by this. Are there any suggested workarounds? I had to downgrade to ms-dotnettools.csharp-1.25.9@win32-x64. as all versions after 2.0 broke the Problems Window in a different way or another.
@ivansalazar Disabling the DevKit extension and setting dotnet.server.useOmnisharp
to true
in settings should give an experience similar to downgrading to 1.x without having to downgrade.
@JoeRobich That doesn’t seem to work for me. I still need to open files for Problems to be found.
@ivansalazar can you check the values of these settings? You'll need to switch them to 'fullSolution' to get diagnostics in closed files.
@dibarbet
Checked with v2.10.28. Both settings set to fullSolution, true on use omnisharp.
Still broken.
The easiest example I have is having an EF Core data model and a set of Razor Pages doing CRUD for said model. Changing the name of one of the entities in a mode file breaks the razor pages, but given that those are located in different files, they are only analyzed when opened. And this is not a large project by any means. I have like 50 files, tops. 10 entities, 5 pages (index, create, details, update, delete) each.
Ah are the missing diagnostics in Razor files? @davidwengier does Razor report full solution diagnostics? Or only open files
Generally speaking, only open files. I think we report some issues for closed files in VS Code when UseOmniSharp is false, but thats a happy accident rather than deliberate choice.
@dibarbet
Not only on razor files (I meant the page model file rather than the html page file, anyways).
That was the closest example I could think of, but even across non-razor files this is happening. For example, closed files in my data model aren’t being analyzed. Say, I edit the name of a class that’s used in other closed files in the data model, I would expect errors being reported as the class can’t be found anymore, but nothing happens until I open the other files, one by one.
And as I said, downgrading to 1.x works, as I just downgraded today and errors are reported in mere seconds, as expected.
I am seeing the same behavior. Full-Solution Analysis is not working. If I make a change in a file, I see the "Analyzing Files" icon flash briefly in the footer, but it goes away immediately and the "problems" count only updates for the file that I have open. I have Full Solution set on both of the values mentioned above, and have it set to use OmniSharp.
VSCode version: 1.85.1 C# Extension: 2.15.30 Using OmniSharp: true
There are two types of diagnostics reported by C#/Devkit extensions. Some are live diagnostics reported by analyzers and some are build diagnostics reported by the build. Live diagnostics may be computed for open files only, or for every file via full solution analysis.
Full solution analysis (FSA) can be slow for large projects. Due to deduping of build and live diagnostics, if FSA is on build diagnostics are ignored unless they are "build-only" (i.e. cannot be reported live). This means that for large projects, where FSA may be slow to return results, it may take a long time for legitimate problems to appear in the problem window.
Steps to reproduce
Expected behavior
I should see diagnostics as soon as they are available. If the build completes before FSA, I see all the build diagnostics. If FSA finishes first, I see all the live diagnostics.
Actual behavior
Although the build has completed, I don't see problems until they are reported by FSA. Related to work https://github.com/dotnet/vscode-csharp/issues/5728