Properly update workspace options when switching from FSA on to off#72971
Merged
CyrusNajmabadi merged 10 commits intodotnet:mainfrom Apr 10, 2024
Merged
Properly update workspace options when switching from FSA on to off#72971CyrusNajmabadi merged 10 commits intodotnet:mainfrom
CyrusNajmabadi merged 10 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Apr 10, 2024
| _globalOptions.SetGlobalOption(SolutionCrawlerOptionsStorage.BackgroundAnalysisScopeOption, InternalLanguageNames.TypeScript, | ||
| openFilesOnly ? BackgroundAnalysisScope.OpenFiles : BackgroundAnalysisScope.FullSolution); | ||
| _globalOptions.SetGlobalOption(SolutionCrawlerOptionsStorage.CompilerDiagnosticsScopeOption, InternalLanguageNames.TypeScript, | ||
| openFilesOnly ? CompilerDiagnosticsScope.OpenFiles : CompilerDiagnosticsScope.FullSolution); |
Contributor
Author
There was a problem hiding this comment.
both these options are checked, so both need to change in order to get proper behavior corresponding to the single switch TS has.
dibarbet
approved these changes
Apr 10, 2024
| if (!seenDiagnosticSourceIds.Contains(projectOrDocumentId) && | ||
| !removedResults.Contains(previousDiagnosticParams)) | ||
| { | ||
| progress.Report(CreateRemovedReport(previousDiagnosticParams.TextDocument)); |
Member
There was a problem hiding this comment.
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).
Contributor
Author
There was a problem hiding this comment.
sounds good.
CyrusNajmabadi
commented
Apr 10, 2024
| @@ -22,427 +23,424 @@ | |||
| using Xunit.Abstractions; | |||
| using LSP = Roslyn.LanguageServer.Protocol; | |||
|
|
|||
| namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.Diagnostics | |||
Contributor
Author
There was a problem hiding this comment.
view with whitespace off.
This was referenced Apr 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.