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

Refresh diagnostics when fading options change #77322

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #77319

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 24, 2025 09:08
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 24, 2025
// want to recompute and rereport up to date diagnostics.
option == FadingOptions.FadeOutUnusedImports ||
option == FadingOptions.FadeOutUnusedMembers ||
option == FadingOptions.FadeOutUnreachableCode;
Copy link
Member Author

Choose a reason for hiding this comment

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

this controls if the diagnostic service itself broadcasts taht a diagnostics refresh is needed.


return Checksum.Create(diagnosticDataChecksums);
return Checksum.Create(builder);
Copy link
Member Author

Choose a reason for hiding this comment

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

i needed to do tthe above because hte DiagnosticPullCache was computing the 'new daignostic checksum' and getting the same result. This si because it operates purely on DiagnosticData, and not on the 'transformed LSP diagnostics' that it would create from the data.

  1. We could either have it do the transform, and compute the checksum on that.
  2. audit it entirely for all special logic it uses to customize the result it returns.
  3. just add the known info that impacts results.

I opted for '3' for simplicity. Note that there is no actual checking if the option actually impacts the diagnostic results. We effectively just say that if any of these options changed that you should not use the cache and recompute. Given that changing this option would not be a common event, this seems totally reasonable.

@CyrusNajmabadi
Copy link
Member Author

@davidwengier As i know you're awake :D

@CyrusNajmabadi CyrusNajmabadi merged commit 1e7e07b into dotnet:main Feb 24, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Feb 24, 2025
@CyrusNajmabadi CyrusNajmabadi deleted the fadingOptions branch February 24, 2025 15:56
@akhera99 akhera99 modified the milestones: Next, 17.14 P2 Feb 25, 2025
JoeRobich added a commit to dotnet/vscode-csharp that referenced this pull request Mar 8, 2025
* Don't use an implicit-object if the lang version doesn't support it (PR: [#77437](dotnet/roslyn#77437))
* Fix issue where we were changing semantics when converting to a collection expr. (PR: [#77417](dotnet/roslyn#77417))
* Detect and emit more idiomatic null check patterns (PR: [#77412](dotnet/roslyn#77412))
* Partial events and constructors: IDE (PR: [#77337](dotnet/roslyn#77337))
* Simplify keyword recommenders. (PR: [#77396](dotnet/roslyn#77396))
* Remove async/await (PR: [#77397](dotnet/roslyn#77397))
* Preserve encoding during DocumentState updates (PR: [#77354](dotnet/roslyn#77354))
* Don't realize the SourceText in SyntaxTree.OverlapsHiddenPosition if not needed (PR: [#77334](dotnet/roslyn#77334))
* Handle ModuleCancellationTokenExpression in AbstractFlow visitor (PR: [#77310](dotnet/roslyn#77310))
* PERF: Reduce the number of nodes walked during import completion commit. (PR: [#77305](dotnet/roslyn#77305))
* Allow expression body refactorings on non empty selections (PR: [#76969](dotnet/roslyn#76969))
* Partial events and constructors: public API (PR: [#77202](dotnet/roslyn#77202))
* Refresh diagnostics when fading options change (PR: [#77322](dotnet/roslyn#77322))
* Reduce allocations during completion in FilterToVisibleAndBrowsableSymbols (PR: [#77315](dotnet/roslyn#77315))
* Change override completion to select text after updating the buffer. (PR: [#76983](dotnet/roslyn#76983))
* Fix false positive 'Unnecessary assignment of a value' (PR: [#77297](dotnet/roslyn#77297))
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 VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fading option is not activated on already opened files
3 participants