-
Notifications
You must be signed in to change notification settings - Fork 805
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
Turn off closed files diagnostic analysis & fix creating IncrementalBuilder when a file opens #2395
Turn off closed files diagnostic analysis & fix creating IncrementalBuilder when a file opens #2395
Conversation
use predefined BlockForCompletionItems option instead of hand made one
LGTM, but also tagging @heejaechang to take a look. |
@Pilchie @cartermp @vasily-kirichenko This feels like it might cause considerable pain on VS2017 RTM? |
@vasily-kirichenko I think this also addresses #1856? What do you think? thanks |
Yes, it's a very annoying. Having your CPU busy all time is not what you like to have. I'm not sure it turns off ProjectDiagnosticsAnalyzer (yes, it's commented out, but we will want to turn it on at some point). |
@dsyme Do you mean this PR, or the symptom it's addressing? Closed File Diagnostics are off by default in C# as well, so I think this is a good change. |
👍 and yes, it turns off ProjectDiagnosticAnalyzer now, but I am planning to turn it on soon. |
@vasily-kirichenko That's fantastic! |
@dsyme yeah, a couple of lines of code changes, but the effect is huge :) |
…uilder when a file opens (dotnet#2395) * turn off closed files diagnostic analysis use predefined BlockForCompletionItems option instead of hand made one * fixed: IncrementalBuilder is created every time a file in project opened / reopened
This fixes #2389
In short, Roslyn by default performs "closed files diagnostic" analysis, which means it calls all
DocumentDiagnosticsAnalyzer
derivatives for all file in current project, opened and closed, even if a single file changed. This resulted with callingParseAndCheckFileInProject
for all files, which in turn madeparseAndCheckFileInProjectCache
useless.BlockForCompletionItems
option instead of hand made one. Now completion feels really non-blocking.This also fixes #2324
LanguageService.SetupProjectFile
is called every time a file is opening https://github.com/Microsoft/visualfsharp/blob/master/vsintegration/src/FSharp.Editor/Common/LanguageService.fs#L298UpdateProjectInfo
https://github.com/Microsoft/visualfsharp/blob/master/vsintegration/src/FSharp.Editor/Common/LanguageService.fs#L307Checker.InvalidateConfiguration
https://github.com/Microsoft/visualfsharp/blob/master/vsintegration/src/FSharp.Editor/Common/LanguageService.fs#L117IncrementalBuilder
https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/vs/service.fs#L2716 and replaced the old one.I'm surprised anything worked at all :(