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

Properly update workspace options when switching from FSA on to off #72971

Merged
merged 10 commits into from
Apr 10, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Apr 10, 2024

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.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner April 10, 2024 18:47
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 10, 2024
@CyrusNajmabadi CyrusNajmabadi requested a review from dibarbet April 10, 2024 18:47
@@ -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);
Copy link
Member Author

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));
Copy link
Member

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).

Copy link
Member Author

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view with whitespace off.

@CyrusNajmabadi CyrusNajmabadi merged commit 3969ebd into dotnet:main Apr 10, 2024
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 10, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the fsaSwitch branch April 10, 2024 22:17
@dibarbet dibarbet modified the milestones: Next, 17.11 P1 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants