Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS enable diagnostics for unopened files #15591

Merged

Conversation

T-Gro
Copy link
Member

@T-Gro T-Gro commented Jul 12, 2023

This PR brings in an optional checkbox for enabling solution-wide background analysis.
The default remains "false" - only opened documents are being analyzed.

Once this is turned on, unopened documents in all projects will also be analyzed for diagnostics.
This is a rough summary of the priorities:

  1. Language features for currently active document
  2. Collect diagnostics of other open documents via a lower-prio background activity
  3. (after no-activity delay) - background processing of all other documents and projects, project-by-project

Any change is typed to active document => stop #2/#3, go back to #1 and start over

During active typing, no background analysis is running at all.

image

This does work together with the "live buffers" option:
image

The tests for the functionality exist in the Roslyn repository.
Remark: GH research indicates that the Roslyn's SolutionCrawler is on a path of being deprecated in the future, and this might need a different impl in the LSP-future of F#. I think it still makes sense to enable background analysis as an option despite knowing that.

@T-Gro T-Gro marked this pull request as ready for review July 12, 2023 15:25
@T-Gro T-Gro requested a review from a team as a code owner July 12, 2023 15:25
@vzarytovskii
Copy link
Member

How is vram compared with and without this option on something like VisualFSharp or FCS solution?

@T-Gro
Copy link
Member Author

T-Gro commented Jul 12, 2023

How is vram compared with and without this option on something like VisualFSharp or FCS solution?

I had the before/after Visual Studios side by side and did not spot any memory usage increase, the caches are being evicted and not kept strongly. This also means it does take longer and is not at all smart about avoiding work (we do not have "cross project graph checking"), for VisualFsharp.sln it was easily several minutes before the full solution was analyzed.

@vzarytovskii
Copy link
Member

Can you please ensure we're sending state of the option in telemetry? So we can filter it out when looking at perf data?

@T-Gro
Copy link
Member Author

T-Gro commented Jul 17, 2023

ok, will redo it to include that option in telemetry.

@T-Gro
Copy link
Member Author

T-Gro commented Jul 17, 2023

@vzarytovskii : Reported as a boolean property nameof solutionCrawler, solutionCrawler

@psfinaki psfinaki merged commit 40d789c into dotnet:main Jul 17, 2023
@T-Gro T-Gro deleted the 15008-vs-enable-diagnostics-for-unopened-files branch July 17, 2023 17:25
@T-Gro T-Gro linked an issue Jul 18, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

VS: enable diagnostics for unopened files
5 participants