-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Properly update workspace options when switching from FSA on to off #72971
Conversation
@@ -28,6 +28,8 @@ public void SetBackgroundAnalysisScope(bool openFilesOnly) | |||
{ | |||
_globalOptions.SetGlobalOption(SolutionCrawlerOptionsStorage.BackgroundAnalysisScopeOption, InternalLanguageNames.TypeScript, | |||
openFilesOnly ? BackgroundAnalysisScope.OpenFiles : BackgroundAnalysisScope.FullSolution); | |||
_globalOptions.SetGlobalOption(SolutionCrawlerOptionsStorage.CompilerDiagnosticsScopeOption, InternalLanguageNames.TypeScript, | |||
openFilesOnly ? CompilerDiagnosticsScope.OpenFiles : CompilerDiagnosticsScope.FullSolution); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both these options are checked, so both need to change in order to get proper behavior corresponding to the single switch TS has.
if (!seenDiagnosticSourceIds.Contains(projectOrDocumentId) && | ||
!removedResults.Contains(previousDiagnosticParams)) | ||
{ | ||
progress.Report(CreateRemovedReport(previousDiagnosticParams.TextDocument)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to note here that we're creating a removed report because as far as the client is concerned for diagnostics - the document is removed.
We don't want to create an empty report as that might mean the client thinks we're still reporting diagnostics for it (but with none).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good.
@@ -22,427 +23,424 @@ | |||
using Xunit.Abstractions; | |||
using LSP = Roslyn.LanguageServer.Protocol; | |||
|
|||
namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.Diagnostics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view with whitespace off.
Previously, this could lead to 'stuck' diagnostics in the error list if FSA was on, but was then turned off. Only a restart would remove them. Now, you can turn FSA off, and existnig errors in closed files should disappear.