-
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
Fixed DDRIT failure #25551
Fixed DDRIT failure #25551
Conversation
…t change. this is needed to bring workspace up to date with latest text snapshot after we don't merge 2 text snapshot to 1 source text if content is same. see this for more detail - dotnet#24849
@jasonmalinowski @dotnet/roslyn-ide @jinujoseph @Pilchie can you take a look? |
1b0215e
to
f297127
Compare
@@ -100,18 +100,21 @@ public override SourceText CurrentText | |||
private void OnTextContentChanged(object sender, TextContentChangedEventArgs args) | |||
{ | |||
var changed = this.EtextChanged; | |||
if (changed != null && args.Changes.Count != 0) | |||
if (changed == null) |
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.
I would suggest a comment indicating that it's important to fire the event even if there are no changes so that consumers can observe the new snapshot.
Otherwise, someone is likely to re-add the optimization at some point in the future.
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.
will do
@jasonmalinowski is this right branch to checkin this change? |
ping? |
* made sure we raise workspace changed events even when there is no text change. this is needed to bring workspace up to date with latest text snapshot after we don't merge 2 text snapshot to 1 source text if content is same. see this for more detail - dotnet#24849 * added comments on why we need to process all text change events
…apshot without changes (#25576) * Fixed DDRIT failure (#25551) * made sure we raise workspace changed events even when there is no text change. this is needed to bring workspace up to date with latest text snapshot after we don't merge 2 text snapshot to 1 source text if content is same. see this for more detail - #24849 * added comments on why we need to process all text change events * removed changes empty check. now it is possible to have empty changes. * remove non-empty from comment since set now can be empty.
fixed issue workspace not raising events if ITextBuffer change doesn't include any text change.
(Fixed cases where 1:1 mapping between Roslyn and editor text buffer/s… #24849)
...
Customer scenario
No user facing change.
Bugs this fixes
N/A
Workarounds, if any
No workaround.
Risk
No risk
Performance impact
it should let us to be slightly more efficient before by not forking solution from Workspace.CurrentSolution unnecessarily.
Is this a regression from a previous update?
Yes
Root cause analysis
We used to share same SourceText for different ITextSnapshots if contents are same. which caused some issues since we expect SourceText to ITextSnapshot is 1:1 map. not 1:n map.
when that is fixed, I forgot to remove optimization in ETextChange event where it swallows events if contents are same.
How was the bug found?
Testing (DDRIT)