dotnet / dotnet/vscode-csharp

[Feature Request] Background analysis for open document only

Open
#6,836 3 comments 2 reactions 1 assignee Claimed by @mavasani View on GitHub
Performance Triaged
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

## Is your feature request related to a problem? Please describe.
VSCode has become increasingly slow due to background code analysis; after every few updates something changes and it becomes even slower than before. It's even slower than the previous O# extension.

When analysis and building occur at the same time my machine becomes completely unusable, it saturates all cores and all memory.

This is the case for `"dotnet.backgroundAnalysis.analyzerDiagnosticsScope"` when set to `openFiles` and `fullSolution`. Setting it to `none` is obviously not a solution.

## Describe the solution you would like
Please add an option to analyse the current file only, e.g. `currentFile`. One must take into account that the user could be switching between many files quickly, but one could debounce that easily.

If that is too tricky, an alternative is to analyse files as they're opened (and stay open for 5 seconds, say, or only after an edit is made) and remember the last "n" files. That means only the files the user is interested in, and actively working on, would be actively analysed. The others would be analysed the normal way during building.

## Applicable Scenarios
All C# projects.

## Describe alternatives you've considered
There are no alternatives. VSCode is fast for large projects in all languages, except c#.

## Additional context
- What would be really nice is to set a limit to the amount of RAM or the number of cores that the analyser is allowed to use. I don't know if that's possible.
- It would be very helpful to have an optional status bar message showing when analysis is taking place (like O#) had; that would make it clear what is the cause of slowdowns

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.