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

Fixed DDRIT failure #25551

Merged

Conversation

heejaechang
Copy link
Contributor

@heejaechang heejaechang commented Mar 17, 2018

fixed issue workspace not raising events if ITextBuffer change doesn't include any text change.

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)

…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
@heejaechang heejaechang requested a review from a team as a code owner March 17, 2018 08:48
@heejaechang heejaechang changed the base branch from dev15.7-preview2-vs-deps to dev15.7.x March 17, 2018 08:49
@heejaechang heejaechang changed the base branch from dev15.7.x to dev15.7-preview2-vs-deps March 17, 2018 08:49
@heejaechang
Copy link
Contributor Author

@jasonmalinowski @dotnet/roslyn-ide @jinujoseph @Pilchie can you take a look?

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

@heejaechang
Copy link
Contributor Author

@jasonmalinowski is this right branch to checkin this change?

@heejaechang
Copy link
Contributor Author

ping?

@heejaechang heejaechang merged commit 0bad1d4 into dotnet:dev15.7-preview2-vs-deps Mar 18, 2018
jasonmalinowski pushed a commit to jasonmalinowski/roslyn that referenced this pull request Mar 19, 2018
* 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
heejaechang pushed a commit that referenced this pull request Mar 20, 2018
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants