-
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
Better handle dismissed rename tracking sessions #983
Conversation
New PR because I cannot reopen #770. We want to eventually the implementation from reanalyzing diagnostics to implementing IDiagnosticUpdateSource, but that depends on #885 being completed. For the current milestone, let's proceed with this interim solution as it fixes certain cases and the rest of the time it avoids the confusion of committing the lightbulb item and having nothing happen. |
@@ -1,13 +1,13 @@ | |||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System; |
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.
Other files in this PR keep the System directives at the top.
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.
Fixed. Thanks Brett.
👍 |
Fixes dotnet#540 "Stale rename entries in the lightbulb menu" Prior to this change, dismissed rename tracking sessions continued to provide codefixes which would silently fail when invoked, without completing the rename operation. With this change, we now do the following when rename tracking is manually dismissed: - Trigger the diagnostic service to reanalyze the document, thus removing the rename tracking diagnostic. - Stop providing a codefix when requested - Show a dialog if a cached codefix is invoked explaining that the rename was not performed. Here are the there user scenarios: 1. The user dismisses rename tracking - The lightbulb will continue to show in the margin, regardless of whether any codefix/refactoring is actually still available. 2. The user expands the lightbulb without it ever having been expanded before. - In this case, we are queried for fixes and will not return any, so either the lightbulb will disappear or it will contain other relevant codefixes/refactorings at that position, excluding rename. 3. The user expands the lightbulb after it was previously expanded. - Our fix was already cached, so we can only give a reasonable message when it is invoked. Once dotnet#885 is fixed, we can instead implement IDiagnosticUpdateSource and avoid forcing diagnostic reanalysis.
a03d9d5
to
499a46f
Compare
@balajikris - can you take a look? |
👍 |
Better handle dismissed rename tracking sessions
Fixes #540 "Stale rename entries in the lightbulb menu"
Prior to this change, dismissed rename tracking sessions continued to
provide codefixes which would silently fail when invoked, without
completing the rename operation.
With this change, we now do the following when rename tracking is
manually dismissed:
removing the rename tracking diagnostic.
rename was not performed.
Here are the there user scenarios:
whether any codefix/refactoring is actually still available.
before.
either the lightbulb will disappear or it will contain other relevant
codefixes/refactorings at that position, excluding rename.
when it is invoked.
Once #885 is fixed, we can instead implement IDiagnosticUpdateSource and
avoid forcing diagnostic reanalysis.